Skip to content

Commit

Permalink
fix(Sticky): should not detect scroll when hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Mar 11, 2020
1 parent 7af2c99 commit 41e5c03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/sticky/index.js
@@ -1,6 +1,7 @@
import { isHidden } from '../utils/dom/style';
import { createNamespace, isDef } from '../utils';
import { BindEventMixin } from '../mixins/bind-event';
import { getScrollTop, getElementTop, getScroller } from '../utils/dom/scroll';
import { BindEventMixin } from '../mixins/bind-event';

const [createComponent, bem] = createNamespace('sticky');

Expand Down Expand Up @@ -59,6 +60,10 @@ export default createComponent({

methods: {
onScroll() {
if (isHidden(this.$el)) {
return;
}

this.height = this.$el.offsetHeight;

const { container } = this;
Expand Down

0 comments on commit 41e5c03

Please sign in to comment.