ElemeFE / ElemeFE/element

#### 级联抖动

Open
#21,844 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

#### 级联也会抖动
- 缩放的情况下,获取到的dom的高度是一个浮点数.然后你又为tag模式下的话,他会监听这个高度,来适应是否换行展示.
- 所以dom更新完毕后就会触发监听.
- 然后还用的**Math.round**取的整(感觉这里用个Math.ceil向上取整更合适),导致高度在修改,在监听,在修改..
- 所以造成了抖动问题,Math.round 应该select也在用,所以是相同的问题
- 不知道后续可不可以修改成 **Math.ceil**.

### 相关代码如下
![image](https://user-images.githubusercontent.com/26239511/162443765-0c5c69c9-0efd-4715-a34e-4673ebe8d3fc.png)
```
if (tags) {
var offsetHeight = Math.round(tags.getBoundingClientRect().height);
var height = Math.max(offsetHeight + 6, inputInitialHeight) + 'px';
inputInner.style.height = height;
if (this.dropDownVisible) {
this.updatePopper();
}
}
```

_Originally posted by @hanjituan in https://github.com/ElemeFE/element/issues/20552#issuecomment-1092858510_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.