GeezerVison is showing github.com — fix[devtools/tree/element]: onClick -> onMouseDown to handle first click correctly by hoxyq · Pull Request #28486 · react/react
Conversation
hoxyq
commented
Mar 4, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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:
- For elements, which were not previously rendered (for virtualization purposes).
- 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
before.mov
After
after1.mov
Tested that it works in all shells, including the select / deselect features (with metaKey param in event).
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|