Commit ff4875c
committed
fix: restore smallest-area fallback and exclude decorative overlays from index
The bugbot-driven change from smallest-area to first-valid (topmost)
in the fallback path reintroduced the original "stuck on decorative
overlay" bug. Decorative overlay divs (positioned, empty, transparent)
are topmost in elementsFromPoint results, so taking the first valid
element returns the overlay instead of the content underneath.
Fallback path: restored smallest-area selection. elementsFromPoint
returns in z-order; smallest-area naturally skips large overlays in
favor of specific content elements. Handles modals correctly because
modal content elements are smaller than background content at the
same point.
Prehit path: exclude positioned elements with no children and no text
from the R-tree. These are decorative hover-effect divs that should
never be selection targets. The stacking-order sort then operates only
on meaningful content elements.1 parent de5ffe6 commit ff4875c
File tree
2 files changed
+14
-4
lines changed- packages/react-grab/src/utils
2 files changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | | - | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
| |||
0 commit comments