Skip to content

Commit c50e8dd

Browse files
authored
Select: fix a bug that makes the browser jitter in zoom mode (#21197)
1 parent 4d7d24b commit c50e8dd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/select/src/select.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,11 +646,12 @@
646646
let inputChildNodes = this.$refs.reference.$el.childNodes;
647647
let input = [].filter.call(inputChildNodes, item => item.tagName === 'INPUT')[0];
648648
const tags = this.$refs.tags;
649+
const tagsHeight = Math.round(tags.getBoundingClientRect().height);
649650
const sizeInMap = this.initialInputHeight || 40;
650651
input.style.height = this.selected.length === 0
651652
? sizeInMap + 'px'
652653
: Math.max(
653-
tags ? (tags.clientHeight + (tags.clientHeight > sizeInMap ? 6 : 0)) : 0,
654+
tags ? (tagsHeight + (tagsHeight > sizeInMap ? 6 : 0)) : 0,
654655
sizeInMap
655656
) + 'px';
656657
if (this.visible && this.emptyText !== false) {

0 commit comments

Comments
 (0)