Skip to content

Commit 8401475

Browse files
committed
fix: scrollToBottom on Firefox
1 parent 3eca7dd commit 8401475

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/DynamicScroller.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import RecycleScroller from './RecycleScroller.vue'
3434
import { props, simpleArray } from './common'
3535
36+
const MAX_SCROLL = 9999999999
37+
3638
export default {
3739
name: 'DynamicScroller',
3840
@@ -191,12 +193,12 @@ export default {
191193
const el = this.$el
192194
// Item is inserted to the DOM
193195
this.$nextTick(() => {
194-
el.scrollTop = Number.MAX_SAFE_INTEGER
196+
el.scrollTop = MAX_SCROLL
195197
// Item sizes are computed
196198
const cb = () => {
197-
el.scrollTop = Number.MAX_SAFE_INTEGER
199+
el.scrollTop = MAX_SCROLL
198200
requestAnimationFrame(() => {
199-
el.scrollTop = Number.MAX_SAFE_INTEGER
201+
el.scrollTop = MAX_SCROLL
200202
if (this.$_undefinedSizes === 0) {
201203
this.$_scrollingToBottom = false
202204
} else {

0 commit comments

Comments
 (0)