@@ -88,8 +88,8 @@ class Bridge {
88
88
if ( Object . keys ( FALSE_TYPES ) . indexOf ( type ) > - 1 ) {
89
89
break
90
90
}
91
- const rawViewClass = TYPES [ type ]
92
91
92
+ const rawViewClass = TYPES [ type ]
93
93
if ( type === '#text' ) {
94
94
ReactNativePrivateInterface . UIManager . createView (
95
95
binding . id ,
@@ -153,8 +153,6 @@ class Bridge {
153
153
parentTag = ROOT_TAG
154
154
}
155
155
156
- // if conflicting indices between create and move,
157
- // add the child at a later index and then to the remaining
158
156
ReactNativePrivateInterface . UIManager . manageChildren (
159
157
parentTag , // containerID
160
158
moveFrom , // moveFromIndices
@@ -167,6 +165,7 @@ class Bridge {
167
165
break
168
166
}
169
167
case 'event' : {
168
+ const targetId = params [ 0 ]
170
169
this . handleEvent ( 'event' , params )
171
170
break
172
171
}
@@ -363,6 +362,9 @@ function receiveTouches(eventTopLevelType, touches, changedIndices) {
363
362
return
364
363
}
365
364
365
+ if ( nodeId === registry . root ) {
366
+ return
367
+ }
366
368
executeTouchEvent . call ( this , nodeId , eventTopLevelType , nativeEvent )
367
369
}
368
370
@@ -378,14 +380,18 @@ function executeKeyboardEvent(nodeId, eventTopLevelType, nativeEvent = {}) {
378
380
this . enqueue ( 'event' , [ nodeId , eventTopLevelType , nativeEvent ] )
379
381
}
380
382
383
+ // TODO: if used somewhere else, add to
384
+ // a shared folder
385
+ const microTask = fn => setTimeout ( fn , 1 )
386
+
381
387
function process ( ) {
382
388
const q = this . queue || [ ]
383
389
let methodDef = q . shift ( )
384
390
if ( methodDef ) {
385
391
dispatch . call ( this , methodDef )
386
- // setTimeout (() => {
387
- process . call ( this )
388
- // }, 1 )
392
+ microTask ( ( ) => {
393
+ process . call ( this )
394
+ } )
389
395
} else {
390
396
this . processing = false
391
397
}
0 commit comments