(element: HTMLElement, axis: Axis, value: number, smooth = false)
| 1131 | } |
| 1132 | |
| 1133 | function scrollAlongAxis(element: HTMLElement, axis: Axis, value: number, smooth = false) { |
| 1134 | let behavior: ScrollBehavior | undefined = smooth && !reduceMotion() ? 'smooth' : undefined; |
| 1135 | element.scrollTo(axis === 'y' ? {top: value, behavior} : {left: value, behavior}); |
| 1136 | } |
| 1137 | |
| 1138 | // Moves the scroller so the sheet's leading edge sits at the viewport edge, with snapping |
| 1139 | // disabled so the browser doesn't pull it back to a snap point. Returns whether it moved. |
no test coverage detected