ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.1k stars 14.64k forks source link

[Bug Report] Cascader component causes Popper to increase zindex at 110% of the page #17529

Open maczyt opened 4 years ago

maczyt commented 4 years ago

Element UI version

2.12.0

OS/Browsers version

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36

Vue version

2.6.10

Reproduction Link

https://codepen.io/maczyt/pen/bGbOZKL

Steps to reproduce

点击input,显示popper,打开控制台,可以看到元素class="el-popper el-cascader__dropdown"到zindex一直在递增抖动

What is Expected?

不发生抖动,zindex不发生递增

What is actually happening?

发生抖动,zindex发生递增

element-bot commented 4 years ago

Translation of this issue:

Element UI version

2.12.0

OS/Browsers version

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) Apple WebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36

Vue version

2.6.10

Reproduction Link

Https://codepen.io/maczyt/pen/bGbOZKL

Steps to reproduce

Click input, display popper, open the console, and you can see that the element class = "el-popper el-cascader__dropdown" to zindex has been increasing jitter

What is Expected?

Without jitter, zindex does not increase

What is actually happening?

Jitter occurs, zindex increases

myMask commented 4 years ago

Cn: 我也遇到了这种情况; En: Me too.

wpbestway commented 4 years ago

需要修改node_modules/element-ui/lib/cascader.js下的源码: 源码中搜索: Object(resizeevent["addResizeListener"])(this.$el, this.updateStyle); 改为: if (this.filterable) { Object(resizeevent["addResizeListener"])(this.$el, this.updateStyle); } bug原因:源码更新机制问题造成不停更新样式,这里需要增加一个判断即可

yszzu1 commented 3 years ago

2.13.2 still has this issue.
image

The css top attribute is changing between 78px and 79px

yszzu1 commented 3 years ago

the reason may be browser is zoomed as 96%, when zoomed 100%, it's no shake

snowyYU commented 3 years ago

2.15.1 版本还是有这个问题

snowyYU commented 3 years ago

It works well after add specific height to class, like below:

.el-input.el-input--small.el-input--suffix {
    height: 33px;
}
aimiy commented 2 years ago

this may works better

.el-input.el-input--small.el-input--suffix {
  input {
    min-height: 34px !important;
  }
}