File tree Expand file tree Collapse file tree 3 files changed +29
-14
lines changed
packages/vite-plugin-svelte/src/ui/inspector Expand file tree Collapse file tree 3 files changed +29
-14
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @sveltejs/vite-plugin-svelte ' : patch
3+ ---
4+
5+ svelte-inspector: select hovered element instead of parent on mousemouse
Original file line number Diff line number Diff line change 1+ ---
2+ ' @sveltejs/vite-plugin-svelte ' : patch
3+ ---
4+
5+ svelte-inspector: ignore navigation keys while not enabled
Original file line number Diff line number Diff line change 3636 y = event .y ;
3737 }
3838
39- function find_selectable_parent (el ) {
40- do {
39+ function find_selectable_parent (el , include_self = false ) {
40+ if ( ! include_self) {
4141 el = el .parentNode ;
42+ }
43+ while (el) {
4244 if (is_selectable (el)) {
4345 return el;
4446 }
45- } while (el);
47+ el = el .parentNode ;
48+ }
4649 }
4750
4851 function find_selectable_child (el ) {
8992 return true ;
9093 }
9194
92- function mouseover (event ) {
93- const el = find_selectable_parent (event . target );
95+ function mouseover ({ target } ) {
96+ const el = find_selectable_parent (target, true );
9497 activate (el, false );
9598 }
9699
171174 if (options .holdMode && enabled) {
172175 enabled_ts = Date .now ();
173176 }
174- } else if (is_nav (event )) {
175- const el = find_selectable_for_nav (event .key );
176- if (el) {
177- activate (el);
178- stop (event );
177+ } else if (enabled) {
178+ if (is_nav (event )) {
179+ const el = find_selectable_for_nav (event .key );
180+ if (el) {
181+ activate (el);
182+ stop (event );
183+ }
184+ } else if (is_open (event )) {
185+ open_editor (event );
179186 }
180- } else if (is_open (event )) {
181- open_editor (event );
182187 }
183188 }
184189
217222
218223 function activate_initial_el () {
219224 const hov = innermost_hover_el ();
220- let el = is_selectable (hov) ? hov : find_selectable_parent (hov);
225+ let el = find_selectable_parent (hov, true );
221226 if (! el) {
222227 const act = document .activeElement ;
223- el = is_selectable (act) ? act : find_selectable_parent (act);
228+ el = find_selectable_parent (act, true );
224229 }
225230 if (! el) {
226231 el = find_selectable_child (document .body );
You can’t perform that action at this time.
0 commit comments