Skip to content

Commit

Permalink
Select: fix a bug that makes the browser jitter in zoom mode (#21197)
Browse files Browse the repository at this point in the history
  • Loading branch information
cs1707 committed Aug 3, 2021
1 parent 4d7d24b commit c50e8dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/select/src/select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -646,11 +646,12 @@
let inputChildNodes = this.$refs.reference.$el.childNodes;
let input = [].filter.call(inputChildNodes, item => item.tagName === 'INPUT')[0];
const tags = this.$refs.tags;
const tagsHeight = Math.round(tags.getBoundingClientRect().height);
const sizeInMap = this.initialInputHeight || 40;
input.style.height = this.selected.length === 0
? sizeInMap + 'px'
: Math.max(
tags ? (tags.clientHeight + (tags.clientHeight > sizeInMap ? 6 : 0)) : 0,
tags ? (tagsHeight + (tagsHeight > sizeInMap ? 6 : 0)) : 0,
sizeInMap
) + 'px';
if (this.visible && this.emptyText !== false) {
Expand Down

0 comments on commit c50e8dd

Please sign in to comment.