@planet/maps 10.1.0-dev.1718183367135 → 10.1.0-dev.1718184326740
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/internal/render.js +5 -1
- package/package.json +1 -1
package/internal/render.js
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
} from './update.js';
|
|
23
23
|
|
|
24
24
|
const listenerRegex = /^on([A-Z].*)/;
|
|
25
|
+
const listenerColonRegex = /^onChange-/;
|
|
25
26
|
|
|
26
27
|
function upperFirst(str) {
|
|
27
28
|
return str[0].toUpperCase() + str.slice(1);
|
|
@@ -47,7 +48,10 @@ export function updateInstanceFromProps(instance, props, oldProps = {}) {
|
|
|
47
48
|
}
|
|
48
49
|
if (listenerRegex.test(key)) {
|
|
49
50
|
const listener = props[key];
|
|
50
|
-
const type = key
|
|
51
|
+
const type = key
|
|
52
|
+
.replace(listenerColonRegex, 'onChange:')
|
|
53
|
+
.replace(listenerRegex, '$1')
|
|
54
|
+
.toLowerCase();
|
|
51
55
|
instance.on(type, listener);
|
|
52
56
|
if (oldProps[key]) {
|
|
53
57
|
instance.un(type, oldProps[key]);
|