Commit d5f3c50
authored
chore[DevTools/Tree]: don't pre-select root element and remove unused code (facebook#32015)
In this PR:
1. Removed unused code in `Tree.js`
2. Removed logic for pre-selecting first element in the tree by default.
This is a bit clowny, because it steals focus and resets scroll, when
user attempts to expand / collapse some subtree.
3. Updated comments around
facebook@1c381c5.
To expand on 3-rd point, for someone who might be reading this in the
future:
We can't guarantee focus of RDT browser extension panels, because they
are hosted in an `iframe`. Attempting to fire any events won't have any
result, user action with the corresponding `iframe` is required in order
for this `iframe` to obtain focus.
The only reason why built-in Elements panel in Chrome works correctly is
because it is supported natively somewhere in Chrome / Chrome DevTools.
Also, when you select an element on the application page, Chrome will
make sure that Elements panel opened, which technically guarantees focus
inside DevTools window and Elements panel subview.
As of today, we can't navigate user to third-party extensions panels,
there is no API for this, hence no ability to guarantee focused RDT
panels.1 parent 79dcc47 commit d5f3c50
File tree
1 file changed
+5
-30
lines changed1 file changed
+5
-30
lines changedLines changed: 5 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | 45 | | |
47 | | - | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
52 | | - | |
53 | | - | |
54 | | - | |
| 50 | + | |
55 | 51 | | |
56 | 52 | | |
57 | 53 | | |
| |||
96 | 92 | | |
97 | 93 | | |
98 | 94 | | |
99 | | - | |
| 95 | + | |
| 96 | + | |
100 | 97 | | |
101 | 98 | | |
102 | 99 | | |
| |||
112 | 109 | | |
113 | 110 | | |
114 | 111 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | 112 | | |
121 | 113 | | |
122 | 114 | | |
| |||
214 | 206 | | |
215 | 207 | | |
216 | 208 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
| 209 | + | |
227 | 210 | | |
228 | 211 | | |
229 | 212 | | |
| |||
294 | 277 | | |
295 | 278 | | |
296 | 279 | | |
297 | | - | |
298 | 280 | | |
299 | 281 | | |
300 | | - | |
301 | 282 | | |
302 | 283 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
| 284 | + | |
310 | 285 | | |
311 | 286 | | |
312 | 287 | | |
| |||
0 commit comments