mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-18 12:34:25 +08:00
fix(affix): top shift when scroll too fast
This commit is contained in:
parent
79635958a5
commit
4ac69c5b24
@ -74,7 +74,9 @@ export default {
|
|||||||
const {
|
const {
|
||||||
top
|
top
|
||||||
} = this.$el.getBoundingClientRect()
|
} = this.$el.getBoundingClientRect()
|
||||||
this.memorizedTop = top
|
const containerScrollTop = this.container.scrollTop
|
||||||
|
const delta = containerScrollTop - this.top
|
||||||
|
this.memorizedTop = top + delta
|
||||||
},
|
},
|
||||||
handleScroll (e) {
|
handleScroll (e) {
|
||||||
const containerEl = this.container.nodeName === '#document' ? this.container.documentElement : this.container
|
const containerEl = this.container.nodeName === '#document' ? this.container.documentElement : this.container
|
||||||
|
Loading…
Reference in New Issue
Block a user