fix(DropdownMenu): incorrect menu position when scroll (#5313)

This commit is contained in:
neverland
2019-12-19 16:51:41 +08:00
committed by GitHub
parent df6de0c7e4
commit 329a5cd0c3
3 changed files with 27 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ import { createNamespace } from '../utils';
import { BORDER_TOP_BOTTOM } from '../utils/constant';
import { ParentMixin } from '../mixins/relation';
import { ClickOutsideMixin } from '../mixins/click-outside';
import { getScrollEventTarget } from '../utils/dom/scroll';
const [createComponent, bem] = createNamespace('dropdown-menu');
@@ -44,6 +45,12 @@ export default createComponent({
};
},
computed: {
scroller() {
return getScrollEventTarget(this.$el);
}
},
methods: {
updateOffset() {
const { menu } = this.$refs;