Issue metadata
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 descriptionUserAgent: 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
,
Mar 9 2016
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.
,
Mar 9 2016
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?
,
Mar 11 2016
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.
,
Mar 12 2016
So would a delay be feasible or does that open up problems?
,
Mar 12 2016
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.
,
Mar 14 2016
So the way to keep the selection is to make sure React doesn't replace the element but edits it?
,
Jul 23 2016
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!
,
Oct 28 2016
Bringing this back since there is more interest in this!
,
Oct 28 2016
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.
,
Dec 5 2017
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by alph@chromium.org
, Mar 8 2016Status: Assigned (was: Unconfirmed)