Skip to content

Commit 7740b6b

Browse files
authored
fix scrollTo
1 parent 5523650 commit 7740b6b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@ module.exports = ({ history, elementId, reset = true, limit = 20 }) => {
3838
position = storage.pop();
3939
}
4040

41-
$el && $el.scrollTo(...position);
41+
if($el && $el.scrollTo) {
42+
$el.scrollTo(...position);
43+
}
4244

4345
break;
4446
case 'PUSH':
4547
if(reset || (resetScroll && resetOnAction === 'PUSH')) {
46-
$el && $el.scrollTo(...position);
48+
if($el && $el.scrollTo) {
49+
$el.scrollTo(...position);
50+
}
4751
}
4852

4953
break;

0 commit comments

Comments
 (0)