Ver código fonte

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

好多大米 4 anos atrás
pai
commit
c50e8dd1eb
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      packages/select/src/select.vue

+ 2 - 1
packages/select/src/select.vue

@@ -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) {