Commit 59636c0
authored
fix(sidebar): prevent docs page scrolling when typing in the sidebar filter (#34)
* fix: implement scroll locking during filter input and reset actions
* fix(sidebar-filter): pin scrollY on input mutations to defeat Chrome scroll-into-view
Replace the 15-frame rAF scroll-lock with a leaner combo: disable smooth scroll
while the input has focus (so the unwanted scroll is a single instant jump,
not a 250ms animation) and pin scrollY for ~200ms after each keystroke,
extending the window on held-key repeats to cover Lit's batched re-renders.
* fix(sidebar-filter): move scroll-behavior toggle into pinScrollY
Previously the focus-time scroll-behavior toggle didn't cover the X clear
button (focus leaves the input before resetFilter runs, restoring smooth
mid-mutation and causing a visible stutter). Move the toggle into
pinScrollY itself so 'auto' is in effect for exactly the pin window,
regardless of focus state. Prior inline value (DocsLayout's 'smooth') is
restored when the window ends.1 parent 00df9c7 commit 59636c0
1 file changed
Lines changed: 31 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
| 153 | + | |
155 | 154 | | |
156 | 155 | | |
157 | | - | |
158 | 156 | | |
159 | 157 | | |
160 | 158 | | |
| |||
167 | 165 | | |
168 | 166 | | |
169 | 167 | | |
| 168 | + | |
170 | 169 | | |
171 | 170 | | |
172 | 171 | | |
173 | 172 | | |
174 | 173 | | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
178 | 205 | | |
179 | 206 | | |
180 | 207 | | |
| |||
395 | 422 | | |
396 | 423 | | |
397 | 424 | | |
| 425 | + | |
398 | 426 | | |
399 | 427 | | |
400 | 428 | | |
| |||
0 commit comments