-
Notifications
You must be signed in to change notification settings - Fork 47k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix[devtools/tree/element]: onClick -> onMouseDown to handle first cl…
…ick correctly (#28486) There is a weird behaviour in all shells of RDT: when user opens `Components` tab and scrolls down a tree (without any prior click or focus event), and then clicks on some element, the `click` event will not be fired. Because `click` event hasn't been fired, the `focus` event is fired for the whole list and we pre-select the first (root) element in the tree: https://github.com/facebook/react/blob/034130c02ffb47b0026059b57d17e9b080976ff3/packages/react-devtools-shared/src/devtools/views/Components/Tree.js#L217-L226 Check the demo (before) what is happening. I don't know exactly why `click` event is not fired there, but it only happens: 1. For elements, which were not previously rendered (for virtualization purposes). 2. When HTML-element (div), which represents the container for the tree was not focused previously. Unlike the `click` event, the `mousedown` event is fired consistently. ### Before https://github.com/facebook/react/assets/28902667/9f3ad75d-55d0-4c99-b2d0-ead63a120ea0 ### After https://github.com/facebook/react/assets/28902667/e34816be-644c-444c-8e32-562a79494e44 Tested that it works in all shells, including the select / deselect features (with `metaKey` param in event). DiffTrain build for commit aa4eae6.
- Loading branch information
Showing
7 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0ae2b13412e0e4cf10a799ec645035213834556c | ||
aa4eae6b99a6081afabf180d02fa0a8b0cb1b3ab |