@dcl/react-ecs 7.20.4-22492765829.commit-3a83d2f → 7.20.4-22561917759.commit-d944d0d
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/dist/reconciler/index.js +0 -16
- package/package.json +3 -3
package/dist/reconciler/index.js
CHANGED
|
@@ -18,9 +18,6 @@ export function createReconciler(engine, pointerEvents) {
|
|
|
18
18
|
// Store the onChange callbacks to be runned every time a Result has changed
|
|
19
19
|
const changeEvents = new Map();
|
|
20
20
|
const clickEvents = new Map();
|
|
21
|
-
// Track the last value reported by the renderer for each input entity,
|
|
22
|
-
// so we can avoid echoing it back and causing keystroke drops.
|
|
23
|
-
const lastInputResultValues = new Map();
|
|
24
21
|
// Initialize components
|
|
25
22
|
const UiTransform = components.UiTransform(engine);
|
|
26
23
|
const UiText = components.UiText(engine);
|
|
@@ -114,15 +111,6 @@ export function createReconciler(engine, pointerEvents) {
|
|
|
114
111
|
delete props.onChange;
|
|
115
112
|
delete props.onSubmit;
|
|
116
113
|
}
|
|
117
|
-
// Prevent keystroke drops: when React echoes back the same value the renderer
|
|
118
|
-
// reported, strip it from the props so the component isn't marked dirty for it.
|
|
119
|
-
// This avoids sending a stale value that overwrites what the user is currently typing.
|
|
120
|
-
if (componentName === 'uiInput' &&
|
|
121
|
-
'value' in props &&
|
|
122
|
-
lastInputResultValues.has(instance.entity) &&
|
|
123
|
-
props.value === lastInputResultValues.get(instance.entity)) {
|
|
124
|
-
delete props.value;
|
|
125
|
-
}
|
|
126
114
|
// We check if there is any key pending to be changed to avoid updating the existing component
|
|
127
115
|
if (!Object.keys(props).length) {
|
|
128
116
|
return;
|
|
@@ -137,7 +125,6 @@ export function createReconciler(engine, pointerEvents) {
|
|
|
137
125
|
function removeChildEntity(instance) {
|
|
138
126
|
changeEvents.delete(instance.entity);
|
|
139
127
|
clickEvents.delete(instance.entity);
|
|
140
|
-
lastInputResultValues.delete(instance.entity);
|
|
141
128
|
engine.removeEntity(instance.entity);
|
|
142
129
|
for (const child of instance._child) {
|
|
143
130
|
removeChildEntity(child);
|
|
@@ -193,9 +180,6 @@ export function createReconciler(engine, pointerEvents) {
|
|
|
193
180
|
if (!hasEvent) {
|
|
194
181
|
const resultComponentId = componentId === UiDropdown.componentId ? UiDropdownResult.componentId : UiInputResult.componentId;
|
|
195
182
|
engine.getComponent(resultComponentId).onChange(entity, (value) => {
|
|
196
|
-
if (resultComponentId === UiInputResult.componentId) {
|
|
197
|
-
lastInputResultValues.set(entity, value?.value);
|
|
198
|
-
}
|
|
199
183
|
if (value?.isSubmit) {
|
|
200
184
|
const onSubmit = changeEvents.get(entity)?.get(componentId)?.onSubmitCallback;
|
|
201
185
|
onSubmit && onSubmit(value?.value);
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/react-ecs",
|
|
3
3
|
"description": "Decentraland ECS",
|
|
4
|
-
"version": "7.20.4-
|
|
4
|
+
"version": "7.20.4-22561917759.commit-d944d0d",
|
|
5
5
|
"author": "DCL",
|
|
6
6
|
"bugs": "https://github.com/decentraland/js-sdk-toolchain/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@dcl/ecs": "7.20.4-
|
|
8
|
+
"@dcl/ecs": "7.20.4-22561917759.commit-d944d0d",
|
|
9
9
|
"react": "^18.2.0",
|
|
10
10
|
"react-reconciler": "^0.29.0"
|
|
11
11
|
},
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"tsconfig": "./tsconfig.json"
|
|
41
41
|
},
|
|
42
42
|
"types": "./dist/index.d.ts",
|
|
43
|
-
"commit": "
|
|
43
|
+
"commit": "d944d0d2c33610fa8151a4f771063e28c84ed187"
|
|
44
44
|
}
|