New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 592214 link

Starred by 3 users

Issue metadata

Status: Duplicate
Merged: issue 570345
Owner:
Last visit 29 days ago
Closed: Dec 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

"Inspect Elements" doesn't keep selection after React-refresh

Reported by fabian.z...@gmail.com, Mar 5 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36

Steps to reproduce the problem:
1. Develop an app with facebook-react and live-reload
2. select an element in the inspector
3. change a file which doesn't changed the tree except a "data-reactid"-attribute 

What is the expected behavior?
keep the selection

What went wrong?
The element tree get's folded.

Did this work before? N/A 

Chrome version: 49.0.2623.75  Channel: stable
OS Version: OS X 10.11.3
Flash Version: Shockwave Flash 20.0 r0
 

Comment 1 by alph@chromium.org, Mar 8 2016

Owner: pfeldman@chromium.org
Status: Assigned (was: Unconfirmed)
Owner: lushnikov@chromium.org
It might be that the element is synchronously deleted from DOM and re-created. We get separate messages on those notifications in the front-end and loose the selection. It is unclear how we can detect this other than via artificial delay specifically for this case.
Would that be feasible? It would increase productivity and ease-of-use in some situations a lot.

A different idea: Keep the selection if the DOM-Node (and maybe all it's parents) is equal to the old one regarding attributes and tag name? Or maybe just tag name and place in hierarchy?
The problem is that the node is first deleted and then is re-created. The selection points nowhere in between and hence resets to parent.
So would a delay be feasible or does that open up problems?
Labels: -OS-Mac OS-All
What would the delay do? If you are trying to follow an xpath that same path may not exist so you are still going to the parent node.

Seems to me like this is just a downside to React-based development.
So the way to keep the selection is to make sure React doesn't replace the element but edits it?
Status: WontFix (was: Assigned)
True, if react were to edit the element, then the selection would be reset.
Closing for now as there are now plans to work on this. Feel free to contribute patch!
Status: Assigned (was: WontFix)
Bringing this back since there is more interest in this!
Definitely interest in this. Coluld it be possible to try and find the previously selected element for a certain amount of time before giving up? Rather than try once on DOM creation and fail if not found. 
Mergedinto: 570345
Status: Duplicate (was: Assigned)

Sign in to add a comment