Element: [Bug Report] When scroll parent is body, the position of ElSelect's dropdown in ElDialog is incorrect.

Created on 22 May 2018  ·  12Comments  ·  Source: ElemeFE/element

Element UI version

2.3.9

OS/Browsers version

Windows 7/Chrome 65

Vue version

2.5.2

Reproduction Link

https://jsfiddle.net/mmx38qxw/1951/

Steps to reproduce

Scroll top for a distance and click Show Dialog button. Then click the ElSelect in the dialog.

See the position of the option list.

Note: the actual reason is the result of getScrollParent is body. But the parent of dropdown is html. So the bounding is not consistent.

What is Expected?

The position is correct.

What is actually happening?

The position is not correct.

Most helpful comment

P.s. There is a typo in the comment of getScrollParent function.

// Firefox puts the *scrollTOp* value on `documentElement` instead 

All 12 comments

Reproduction test.
test.zip

P.s. There is a typo in the comment of getScrollParent function.

// Firefox puts the *scrollTOp* value on `documentElement` instead 

@ziyoung 算是 popup 的问题。

像是 HTML 元素上加了 overflow: hidden; 造成的。https://jsfiddle.net/zhiyang/dLw3mmfv/3

html {
  /* overflow: hidden; */
 height: 100%; 
} 

body {
  overflow: auto;
  height: 100%;
  margin: 0;
} 

element-ui 使用的 popper.js 版本有点老了。我在本地试了一下,如果最新版的 popper.js ,就不会出现这个问题了。我们正在考虑升级一下 popper.js。

@ziyoung 期待新的版本。

另外建议增加某个特性开始发布的版本。比如增加了某个prop,在旁边标注一下since xxx version。

@ddddderek 提供一个可重现问题的例子。

@ziyoung 不好意思。我的不是在dialog中。标题没看清楚。
后面我会提一个issues。

@ziyoung dalao这个什么时候能更新呢 还是已经更新过了

某个版本之后有个popper-append-to-body= =
image

now fixed and close.

refs:

ref
doc

Was this page helpful?
0 / 5 - 0 ratings