Commit 1684a53
committed
Improve select dropdown width matching with ResizeObserver
- Replace single useEffect with ResizeObserver for dynamic width tracking
- Automatically handles responsive changes, content updates, and parent resizing
- More reliable than previous approach that only measured width once on mount
- Uses borderBoxSize for more accurate measurements with fallback to offsetWidth
- Maintains portal benefits while ensuring dropdown width always matches trigger1 parent 875bc53 commit 1684a53
1 file changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
60 | 75 | | |
61 | 76 | | |
62 | 77 | | |
| |||
0 commit comments