File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,13 @@ export function scrollIntoView(
88 element : Maybe < Element > ,
99 coverOptions ?: boolean | ScrollIntoViewOptions
1010) {
11- let options : boolean | ScrollIntoViewOptions = { inline : 'nearest' , block : 'nearest' } ;
12- if ( typeof coverOptions === 'boolean' ) {
13- options = coverOptions ;
14- } else if ( typeof coverOptions === 'object' ) {
15- options = Object . assign ( options , coverOptions ) ;
11+ if ( element ?. scrollIntoView ) {
12+ let options : typeof coverOptions = { inline : 'nearest' , block : 'nearest' } ;
13+ if ( typeof coverOptions === 'boolean' ) {
14+ options = coverOptions ;
15+ } else if ( typeof coverOptions === 'object' ) {
16+ options = Object . assign ( options , coverOptions ) ;
17+ }
18+ element . scrollIntoView ( options ) ;
1619 }
17- element ?. scrollIntoView ( options ) ;
1820}
You can’t perform that action at this time.
0 commit comments