File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,9 @@ export type Axis = 'x' | 'y';
22
33export type ScrollDirection = 'left' | 'right' | 'up' | 'down' ;
44
5- export type ScrollSnapAlignment = 'start' | 'end' | 'center' ;
5+ export type ScrollSnapAlignment = 'start' | 'end' | 'center' | 'none' ;
66
7- export type ScrollSnapAlignValue = 'none' | ScrollSnapAlignment ;
8-
9- export type SnapPositionList = Record < ScrollSnapAlignment , number [ ] > ;
7+ export type SnapPositionList = Record < Exclude < ScrollSnapAlignment , 'none' > , number [ ] > ;
108
119export function scrollSnapToNext ( element : HTMLElement , direction : ScrollDirection , scrollToOptions : ScrollToOptions = { behavior : 'smooth' } ) {
1210
@@ -158,7 +156,7 @@ export function getSnapPositions( parent: HTMLElement, excludeOffAxis = true ):
158156
159157 const childStyle = window . getComputedStyle ( child ) ;
160158
161- let [ childAlignY , childAlignX ] = childStyle . getPropertyValue ( 'scroll-snap-align' ) . split ( ' ' ) as ScrollSnapAlignValue [ ] ;
159+ let [ childAlignY , childAlignX ] = childStyle . getPropertyValue ( 'scroll-snap-align' ) . split ( ' ' ) as ScrollSnapAlignment [ ] ;
162160 if ( typeof childAlignX === 'undefined' ) {
163161 childAlignX = childAlignY ;
164162 }
You can’t perform that action at this time.
0 commit comments