Browse Source

Select: update style if initially invisible

Leopoldthecoder 8 years ago
parent
commit
37ee8e9f88
1 changed files with 7 additions and 2 deletions
  1. 7 2
      packages/select/src/select.vue

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

@@ -606,6 +606,11 @@
 
 
       resetInputWidth() {
       resetInputWidth() {
         this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
         this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
+      },
+
+      handleResize() {
+        this.resetInputWidth();
+        if (this.multiple) this.resetInputHeight();
       }
       }
     },
     },
 
 
@@ -632,7 +637,7 @@
       if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
       if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
         this.currentPlaceholder = '';
         this.currentPlaceholder = '';
       }
       }
-      addResizeListener(this.$el, this.resetInputWidth);
+      addResizeListener(this.$el, this.handleResize);
       if (this.remote && this.multiple) {
       if (this.remote && this.multiple) {
         this.resetInputHeight();
         this.resetInputHeight();
       }
       }
@@ -644,7 +649,7 @@
     },
     },
 
 
     destroyed() {
     destroyed() {
-      if (this.resetInputWidth) removeResizeListener(this.$el, this.resetInputWidth);
+      if (this.handleResize) removeResizeListener(this.$el, this.handleResize);
     }
     }
   };
   };
 </script>
 </script>