Commit 9cda24d Mahesh Kothur
committed
1 parent b79ef5a commit 9cda24d Copy full SHA for 9cda24d
File tree 1 file changed +3
-3
lines changed
packages/utilities/src/utilities/smoothScroll
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 17
17
* You can use this for jump to target element by providing event object.
18
18
* it will scroll into view of target by selecting attribute and assigning to id.
19
19
*
20
- * @param {* } e event object and seletor
20
+ * @param {object } { e: Event, Selector: QuerySelector for the target element }
21
21
*/
22
22
const smoothScroll = ( { e, selector } ) => {
23
- if ( e != null ) {
23
+ if ( e !== null ) {
24
24
e . preventDefault ( ) ;
25
25
const id = e . currentTarget . getAttribute ( 'href' ) ;
26
26
document . querySelector ( id ) . scrollIntoView ( {
27
27
behavior : 'smooth' ,
28
28
block : 'start' ,
29
29
} ) ;
30
- } else if ( selector != null ) {
30
+ } else if ( selector !== null ) {
31
31
document . querySelector ( selector ) . scrollIntoView ( {
32
32
behavior : 'smooth' ,
33
33
block : 'start' ,
You can’t perform that action at this time.
0 commit comments