Repository navigation
Commit 69afe38
committed
🐛(frontend) fix drag-and-drop move disabled by viewport breakpoint
The docs grid and the doc tree both gated the "move document"
drag-and-drop on a screen-size breakpoint (isLargeScreen / isDesktop),
derived from window.innerWidth. Browser zoom shrinks window.innerWidth
the same way a narrower window does, so zooming in on a desktop browser
silently disabled drag-and-drop even though the user was still on a
mouse - matching the reported "zoomed in, can't move; zoomed out, can
move" behaviour, in both the docs grid and moving a subdoc in the tree.
Replace the width-based gate with a new hasCoarsePointer flag on
useResponsiveStore, backed by the `(pointer: coarse)` media query. That
feature reflects the actual input device rather than viewport size, so
it stays correct across zoom levels/widths for mouse users while still
disabling drag-and-drop for genuine touch-primary devices.
Verified locally against a running dev server: before the fix the docs
grid rendered zero draggable items below the 768px breakpoint; after
the fix it stays draggable at any width for a mouse-driven context, and
a touch-emulated context still gets the non-draggable fallback. The
doc-tree canDrag/canDrop gate was verified via matchMedia('(pointer:
coarse)') staying false across widths 1280-500 in a mouse context and
true in a touch-emulated context.
Closes #25991 parent 6e5dee3 commit 69afe38
3 files changed
Lines changed: 27 additions & 17 deletions
File tree
- src/frontend/apps/impress/src
- features/docs
- doc-tree/components
- docs-grid/components
- stores
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | 325 | | |
333 | | - | |
| 326 | + | |
334 | 327 | | |
335 | 328 | | |
336 | 329 | | |
337 | 330 | | |
338 | 331 | | |
339 | | - | |
| 332 | + | |
340 | 333 | | |
341 | 334 | | |
342 | 335 | | |
| 336 | + | |
343 | 337 | | |
344 | 338 | | |
345 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| |||
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
| |||
107 | 114 | | |
108 | 115 | | |
109 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
110 | 125 | | |
111 | 126 | | |
112 | 127 | | |
| 128 | + | |
113 | 129 | | |
114 | 130 | | |
115 | 131 | | |
0 commit comments