|
8 | 8 | :md-offset-y="offset.y"
|
9 | 9 | @md-opened="onOpen"
|
10 | 10 | @md-closed="onClose">
|
11 |
| - <input |
| 11 | + <md-input |
12 | 12 | class="md-input md-select-value"
|
13 | 13 | v-model="MdSelect.label"
|
| 14 | + ref="input" |
14 | 15 | readonly
|
15 | 16 | :disabled="disabled"
|
16 | 17 | :required="required"
|
17 | 18 | v-on="$listeners"
|
18 | 19 | @focus.prevent="onFocus"
|
| 20 | + @blur.prevent="removeHighlight" |
19 | 21 | @click="openSelect"
|
20 | 22 | @keydown.down="openSelect"
|
21 | 23 | @keydown.enter="openSelect"
|
22 | 24 | @keydown.space="openSelect" />
|
23 |
| - <md-drop-down-icon ref="icon" @blur.native="removeHighlight" @click.native="openSelect" /> |
| 25 | + <md-drop-down-icon @click.native="openSelect" /> |
24 | 26 |
|
25 | 27 | <keep-alive>
|
26 |
| - <md-menu-content ref="menu" class="md-select-menu" :md-content-class="mdClass" :md-list-class="mdDense && 'md-dense'" :style="menuStyles" :id="uniqueId"> |
| 28 | + <md-menu-content |
| 29 | + ref="menu" |
| 30 | + class="md-select-menu" |
| 31 | + :md-content-class="mdClass" |
| 32 | + :md-list-class="mdDense && 'md-dense'" |
| 33 | + :style="menuStyles" |
| 34 | + :id="uniqueId"> |
27 | 35 | <slot />
|
28 | 36 | </md-menu-content>
|
29 | 37 | </keep-alive>
|
30 | 38 |
|
31 |
| - <md-input class="md-input-fake" v-model="content" :disabled="disabled" readonly /> |
32 |
| - <select readonly v-model="content" v-bind="attributes"></select> |
| 39 | + <input class="md-input-fake" v-model="model" :disabled="disabled" readonly tabindex="-1" /> |
| 40 | + <select readonly v-model="model" v-bind="attributes" tabindex="-1"></select> |
33 | 41 | </md-menu>
|
34 | 42 | </template>
|
35 | 43 |
|
|
88 | 96 | MdSelect.setContent = this.setContent
|
89 | 97 | MdSelect.setMultipleValue = this.setMultipleValue
|
90 | 98 | MdSelect.setMultipleContent = this.setMultipleContent
|
91 |
| - MdSelect.modelValue = this.content |
| 99 | + MdSelect.modelValue = this.model |
92 | 100 |
|
93 | 101 | return { MdSelect }
|
94 | 102 | },
|
|
148 | 156 | applyHighlight () {
|
149 | 157 | this.MdField.focused = false
|
150 | 158 | this.MdField.highlighted = true
|
151 |
| - this.$refs.icon.$el.focus() |
| 159 | + this.$refs.input.$el.focus() |
152 | 160 | },
|
153 | 161 | onClose () {
|
154 | 162 | if (this.didMount) {
|
155 |
| - this.$refs.icon.$el.setAttribute('tabindex', 1) |
156 | 163 | this.applyHighlight()
|
157 | 164 | }
|
158 | 165 | },
|
|
163 | 170 | },
|
164 | 171 | removeHighlight () {
|
165 | 172 | this.MdField.highlighted = false
|
166 |
| - this.$refs.icon.$el.removeAttribute('tabindex') |
167 | 173 | },
|
168 | 174 | openSelect () {
|
169 | 175 | if (!this.disabled) {
|
|
180 | 186 | }
|
181 | 187 | },
|
182 | 188 | setValue (newValue) {
|
183 |
| - this.content = newValue |
| 189 | + this.model = newValue |
184 | 190 | this.setFieldValue()
|
185 | 191 | this.showSelect = false
|
186 | 192 | },
|
|
199 | 205 | setMultipleValue (value) {
|
200 | 206 | const newValue = value
|
201 | 207 |
|
202 |
| - this.toggleArrayValue(this.content, newValue) |
| 208 | + this.toggleArrayValue(this.model, newValue) |
203 | 209 | this.setFieldValue()
|
204 | 210 | },
|
205 | 211 | setMultipleContentByValue () {
|
|
0 commit comments