Repository navigation
Commit 39f1bc4
committed
[RN] Call dispatchNativeEvent when the event target is null (#38007)
## Summary
With `enableNativeEventTargetEventDispatching` on, the Fabric renderer
skipped `dispatchNativeEvent` when the touched view had already
unmounted, so the touch end never reached the JS responder and the next
tap got lost. This passes the null target through instead, so React
Native can still release the responder. It needs
react/react-native#59522 to land first, since `dispatchNativeEvent`
there throws on a null target today.
Fixes #38006
## How did you test this change?
Added a test in `ReactFabric-test.internal.js` that unmounts a view,
dispatches a touch end to its old instance handle, and expects
`dispatchNativeEvent` to get a null target. It fails on main and passes
with this change. Also ran `yarn test packages/react-native-renderer`
(default, `--prod`, www-modern), `yarn flow fabric`, `yarn linc` and
`yarn prettier-check`.
DiffTrain build for [dc9aed3](dc9aed3)1 parent 9e3edeb commit 39f1bc4
21 files changed
Lines changed: 87 additions & 90 deletions
File tree
- compiled-rn
- facebook-fbsource/xplat/js
- RKJSModules/vendor/react
- react-dom/cjs
- react-test-renderer/cjs
- react/cjs
- react-native-github/Libraries/Renderer
- implementations
- tools/eslint-plugin-react-hooks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
427 | 427 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
32438 | 32438 | | |
32439 | 32439 | | |
32440 | 32440 | | |
32441 | | - | |
| 32441 | + | |
32442 | 32442 | | |
32443 | 32443 | | |
32444 | 32444 | | |
32445 | | - | |
| 32445 | + | |
32446 | 32446 | | |
32447 | 32447 | | |
32448 | 32448 | | |
| |||
32479 | 32479 | | |
32480 | 32480 | | |
32481 | 32481 | | |
32482 | | - | |
| 32482 | + | |
32483 | 32483 | | |
32484 | 32484 | | |
32485 | | - | |
| 32485 | + | |
32486 | 32486 | | |
32487 | 32487 | | |
32488 | 32488 | | |
| |||
32632 | 32632 | | |
32633 | 32633 | | |
32634 | 32634 | | |
32635 | | - | |
| 32635 | + | |
32636 | 32636 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
19572 | 19572 | | |
19573 | 19573 | | |
19574 | 19574 | | |
19575 | | - | |
| 19575 | + | |
19576 | 19576 | | |
19577 | 19577 | | |
19578 | 19578 | | |
19579 | 19579 | | |
19580 | 19580 | | |
19581 | 19581 | | |
19582 | | - | |
| 19582 | + | |
19583 | 19583 | | |
19584 | 19584 | | |
19585 | 19585 | | |
| |||
19601 | 19601 | | |
19602 | 19602 | | |
19603 | 19603 | | |
19604 | | - | |
| 19604 | + | |
19605 | 19605 | | |
19606 | 19606 | | |
19607 | | - | |
| 19607 | + | |
19608 | 19608 | | |
19609 | 19609 | | |
19610 | 19610 | | |
| |||
19711 | 19711 | | |
19712 | 19712 | | |
19713 | 19713 | | |
19714 | | - | |
| 19714 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
21637 | 21637 | | |
21638 | 21638 | | |
21639 | 21639 | | |
21640 | | - | |
| 21640 | + | |
21641 | 21641 | | |
21642 | 21642 | | |
21643 | 21643 | | |
21644 | 21644 | | |
21645 | 21645 | | |
21646 | 21646 | | |
21647 | | - | |
| 21647 | + | |
21648 | 21648 | | |
21649 | 21649 | | |
21650 | 21650 | | |
| |||
21666 | 21666 | | |
21667 | 21667 | | |
21668 | 21668 | | |
21669 | | - | |
| 21669 | + | |
21670 | 21670 | | |
21671 | 21671 | | |
21672 | | - | |
| 21672 | + | |
21673 | 21673 | | |
21674 | 21674 | | |
21675 | 21675 | | |
| |||
21792 | 21792 | | |
21793 | 21793 | | |
21794 | 21794 | | |
21795 | | - | |
| 21795 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
32500 | 32500 | | |
32501 | 32501 | | |
32502 | 32502 | | |
32503 | | - | |
| 32503 | + | |
32504 | 32504 | | |
32505 | 32505 | | |
32506 | 32506 | | |
32507 | | - | |
| 32507 | + | |
32508 | 32508 | | |
32509 | 32509 | | |
32510 | 32510 | | |
| |||
32541 | 32541 | | |
32542 | 32542 | | |
32543 | 32543 | | |
32544 | | - | |
| 32544 | + | |
32545 | 32545 | | |
32546 | 32546 | | |
32547 | | - | |
| 32547 | + | |
32548 | 32548 | | |
32549 | 32549 | | |
32550 | 32550 | | |
| |||
33022 | 33022 | | |
33023 | 33023 | | |
33024 | 33024 | | |
33025 | | - | |
| 33025 | + | |
33026 | 33026 | | |
33027 | 33027 | | |
33028 | 33028 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
19589 | 19589 | | |
19590 | 19590 | | |
19591 | 19591 | | |
19592 | | - | |
| 19592 | + | |
19593 | 19593 | | |
19594 | 19594 | | |
19595 | 19595 | | |
19596 | 19596 | | |
19597 | 19597 | | |
19598 | 19598 | | |
19599 | | - | |
| 19599 | + | |
19600 | 19600 | | |
19601 | 19601 | | |
19602 | 19602 | | |
| |||
19618 | 19618 | | |
19619 | 19619 | | |
19620 | 19620 | | |
19621 | | - | |
| 19621 | + | |
19622 | 19622 | | |
19623 | 19623 | | |
19624 | | - | |
| 19624 | + | |
19625 | 19625 | | |
19626 | 19626 | | |
19627 | 19627 | | |
| |||
19893 | 19893 | | |
19894 | 19894 | | |
19895 | 19895 | | |
19896 | | - | |
| 19896 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
21658 | 21658 | | |
21659 | 21659 | | |
21660 | 21660 | | |
21661 | | - | |
| 21661 | + | |
21662 | 21662 | | |
21663 | 21663 | | |
21664 | 21664 | | |
21665 | 21665 | | |
21666 | 21666 | | |
21667 | 21667 | | |
21668 | | - | |
| 21668 | + | |
21669 | 21669 | | |
21670 | 21670 | | |
21671 | 21671 | | |
| |||
21687 | 21687 | | |
21688 | 21688 | | |
21689 | 21689 | | |
21690 | | - | |
| 21690 | + | |
21691 | 21691 | | |
21692 | 21692 | | |
21693 | | - | |
| 21693 | + | |
21694 | 21694 | | |
21695 | 21695 | | |
21696 | 21696 | | |
| |||
21978 | 21978 | | |
21979 | 21979 | | |
21980 | 21980 | | |
21981 | | - | |
| 21981 | + | |
21982 | 21982 | | |
21983 | 21983 | | |
21984 | 21984 | | |
| |||
0 commit comments