Commit c50e8dd1 authored by 好多大米's avatar 好多大米 Committed by GitHub

Select: fix a bug that makes the browser jitter in zoom mode (#21197)

parent 4d7d24b2
...@@ -646,11 +646,12 @@ ...@@ -646,11 +646,12 @@
let inputChildNodes = this.$refs.reference.$el.childNodes; let inputChildNodes = this.$refs.reference.$el.childNodes;
let input = [].filter.call(inputChildNodes, item => item.tagName === 'INPUT')[0]; let input = [].filter.call(inputChildNodes, item => item.tagName === 'INPUT')[0];
const tags = this.$refs.tags; const tags = this.$refs.tags;
const tagsHeight = Math.round(tags.getBoundingClientRect().height);
const sizeInMap = this.initialInputHeight || 40; const sizeInMap = this.initialInputHeight || 40;
input.style.height = this.selected.length === 0 input.style.height = this.selected.length === 0
? sizeInMap + 'px' ? sizeInMap + 'px'
: Math.max( : Math.max(
tags ? (tags.clientHeight + (tags.clientHeight > sizeInMap ? 6 : 0)) : 0, tags ? (tagsHeight + (tagsHeight > sizeInMap ? 6 : 0)) : 0,
sizeInMap sizeInMap
) + 'px'; ) + 'px';
if (this.visible && this.emptyText !== false) { if (this.visible && this.emptyText !== false) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment