Skip to content

Conversation

hoxyq
Copy link
Contributor

@hoxyq hoxyq commented Aug 3, 2025

When the element is pre-selected and the Tree component is mounted, right now we are only applying initial vertical offset, but not the horizontal one.

Because of this, if the DOM element was selected on Elements panel and then user opens Components panel for the first time of the browser DevTools session, depending on the element's depth, it could be hidden.

Similarly to vertical offset, apply horizontal one, but via ref setter.

Before:

473719450-c7d4e471-ea23-43ae-850d-cfa6ee3e5375.mov

After:

Screen.Recording.2025-08-03.at.19.51.15.mov

@gaearon
Copy link
Collaborator

gaearon commented Aug 3, 2025

thank you!

@hoxyq hoxyq merged commit 30fca45 into facebook:main Aug 4, 2025
248 checks passed
@hoxyq hoxyq deleted the devtools/horizontal-initial-offset branch August 4, 2025 11:12
eps1lon pushed a commit to eps1lon/react that referenced this pull request Aug 4, 2025
When the element is pre-selected and the Tree component is mounted,
right now we are only applying initial vertical offset, but not the
horizontal one.

Because of this, if the DOM element was selected on Elements panel and
then user opens Components panel for the first time of the browser
DevTools session, depending on the element's depth, it could be hidden.

Similarly to vertical offset, apply horizontal one, but via ref setter.

### Before:

https://github.com/user-attachments/assets/0ab3cca9-93c1-4e9e-8d23-88330d438912

### After:

https://github.com/user-attachments/assets/10de153a-1e55-4cf7-b1ff-4cc7cb35ba10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants