Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Dialog里嵌套有Select的Table,当Dialog出现滚动条时,Select 下拉框位置错误 #3952

Closed
MrYuJ opened this issue Apr 1, 2017 · 8 comments

Comments

@MrYuJ
Copy link

MrYuJ commented Apr 1, 2017

Element UI version

1.2.7

OS/Browsers version

chrome57

Vue version

2.2.6

Reproduction Link

https://jsfiddle.net/uonhh83t/

Steps to reproduce

Dialog里嵌套有Select的Table,当Dialog有滚动条并滚动时,Select 下拉框top值没有相应改变
1491032372 1
1491032419 1

What is Expected?

Dialog里嵌套有Select的Table,当Dialog有滚动条并滚动时,Select 下拉框top值应根据滚动偏移量相应变化

What is actually happening?

Dialog里嵌套有Select的Table,当Dialog有滚动条并滚动时,Select 下拉框top值没有相应改变

@MrYuJ
Copy link
Author

MrYuJ commented Apr 7, 2017

@Leopoldthecoder @QingWei-Li 有空请麻烦看一下 谢谢

@Leopoldthecoder
Copy link
Contributor

比较难处理,考虑今天晚些时候发布的新版本中先暂时支持一下,根本解决还需要时间。

Leopoldthecoder added a commit to Leopoldthecoder/element that referenced this issue Apr 7, 2017
baiyaaaaa pushed a commit that referenced this issue Apr 7, 2017
* Popper: workaround for #3952

* Changelog: update for 1.2.8
@MrYuJ
Copy link
Author

MrYuJ commented Apr 8, 2017

@Leopoldthecoder 昨晚更新了之后 这个https://jsfiddle.net/az8ttec8/1/ demo确实支持了这个问题……但是,刚好我们项目用的模态框是自己写的 就不行了……看了你们的Dialog源码发现当打开模态框时会绑定一个滚动事件去更新各种下拉框的top值“this.$el.addEventListener('scroll', this.updatePopper);”
我现在是判断当下拉框出现的时候 获取它的top值 然后绑定scroll事件到我们的模态框上,滚动多少,下拉框top值相应改变多少。但下拉框不止一种,除了select还有日期选择也会有,所以处理起来还是蛮麻烦的感觉。所以,请问如果我们用自己的模态框想处理这个问题你有什么建议吗?

@MrYuJ
Copy link
Author

MrYuJ commented Apr 8, 2017

https://jsfiddle.net/az8ttec8/2/ 刚试了一下,发现日期选择器是不行的……难道是因为
updatePopper: function updatePopper() { this.broadcast('ElSelectDropdown', 'updatePopper'); this.broadcast('ElDropdownMenu', 'updatePopper'); }
updatePopper只更新了ElSelectDropdown,ElDropdownMenu这两个组件?

@Leopoldthecoder
Copy link
Contributor

对,昨天的版本只是紧急支持了这两个。自己处理的话,Element 所有下拉框的 DOM 元素都带有 x-placement 属性,可以在模态框的 scroll 事件回调里获取这些元素一起处理。

@MrYuJ
Copy link
Author

MrYuJ commented Apr 8, 2017

好的 谢谢你希望element-ui越来越好

caikan pushed a commit to caikan/element that referenced this issue Apr 20, 2017
* Popper: workaround for ElemeFE#3952

* Changelog: update for 1.2.8
@daizhikai
Copy link

顺便提下,在mac pro的chrome、safari浏览器里,下拉框选择后没效果,但是值是改了的。(官网demo没这个问题,用cdn的方式导致的?)
image
image

@daizhikai
Copy link

在windows也不行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants