Skip to content

Commit e3eb993

Browse files
committedOct 22, 2017
fix(MdSelect): prevent select from getting a wrong highlight when mounted
1 parent e965e86 commit e3eb993

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed
 

‎src/components/MdField/MdSelect/MdSelect.vue

+7-3
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@
154154
}
155155
},
156156
onFocus () {
157-
this.applyHighlight()
157+
if (this.didMount) {
158+
this.applyHighlight()
159+
}
158160
},
159161
removeHighlight () {
160162
this.MdField.highlighted = false
@@ -218,10 +220,12 @@
218220
}
219221
}
220222
},
221-
mounted () {
223+
async mounted () {
222224
this.showSelect = false
223-
this.didMount = true
224225
this.setFieldContent()
226+
227+
await this.$nextTick()
228+
this.didMount = true
225229
}
226230
}
227231
</script>

0 commit comments

Comments
 (0)