(smooth: boolean)
| 370 | // Open at the first custom detent when provided, otherwise the fully-entered position. |
| 371 | let initial = element.querySelector<HTMLElement>('[data-sheet-initial]'); |
| 372 | let scrollToRest = (smooth: boolean) => { |
| 373 | if (initial) { |
| 374 | scrollDetentIntoView(scroller, initial, axis, after ? 'start' : 'end', smooth); |
| 375 | } else { |
| 376 | scrollAlongAxis(scroller, axis, (enteredScroll / 100) * vp, smooth); |
| 377 | } |
| 378 | }; |
| 379 | if (enteredScroll === 0) { |
| 380 | // The rest position is at scroll 0, so the sheet mounts already entered. Jump to the exit |
| 381 | // first, then animate back in on the next frame — doing both in the same task can leave |
no test coverage detected