@heartlandone/vega-react 2.0.0-preview-2 → 2.0.0-preview-3
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.
|
@@ -20,7 +20,7 @@ export const attachProps = (node, newProps, oldProps = {}) => {
|
|
|
20
20
|
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
21
21
|
const eventName = name.substring(2);
|
|
22
22
|
const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
|
|
23
|
-
if (!isCoveredByReact(eventNameLc)) {
|
|
23
|
+
if (!isCoveredByReact(eventNameLc) || shouldAddSyncEventFallback(eventName)) {
|
|
24
24
|
syncEvent(node, eventNameLc, newProps[name]);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -109,3 +109,12 @@ const arrayToMap = (arr) => {
|
|
|
109
109
|
arr.forEach((s) => map.set(s, s));
|
|
110
110
|
return map;
|
|
111
111
|
};
|
|
112
|
+
function shouldAddSyncEventFallback(eventName) {
|
|
113
|
+
// onChange handle not works for custom component before react 19
|
|
114
|
+
// https://github.com/facebook/react/issues/22888
|
|
115
|
+
if (eventName === "Change" &&
|
|
116
|
+
FeatureFlag.isEnabled("VEGA_REACT.ENABLE_ON_CHANGE_HANDLE_UNDER_LOW_VERSION")) {
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
return false;
|
|
120
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heartlandone/vega-react",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "2.0.0-preview-
|
|
4
|
+
"version": "2.0.0-preview-3",
|
|
5
5
|
"description": "React specific wrapper for @heartlandone/vega",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"stencil-postbuild": "node ./src/scripts/stencil-post-build-script.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"typescript": "^4.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@heartlandone/vega": "2.0.0-preview-
|
|
42
|
+
"@heartlandone/vega": "2.0.0-preview-3"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": ">=16.7.0",
|