File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 255
255
$input .setAttribute (' aria-activedescendant' , ` ${ this .id } -item-${ this .highlightedIndex } ` );
256
256
},
257
257
getInput () {
258
- return this .$refs .input .$refs . input || this . $refs . input . $refs . textarea ;
258
+ return this .$refs .input .getInput () ;
259
259
}
260
260
},
261
261
mounted () {
Original file line number Diff line number Diff line change 221
221
222
222
methods: {
223
223
focus () {
224
- ( this .$refs . input || this . $refs . textarea ).focus ();
224
+ this .getInput ( ).focus ();
225
225
},
226
226
blur () {
227
- ( this .$refs . input || this . $refs . textarea ).blur ();
227
+ this .getInput ( ).blur ();
228
228
},
229
229
getMigratingConfig () {
230
230
return {
245
245
}
246
246
},
247
247
select () {
248
- ( this .$refs . input || this . $refs . textarea ).select ();
248
+ this .getInput ( ).select ();
249
249
},
250
250
resizeTextarea () {
251
251
if (this .$isServer ) return ;
287
287
// set input's value, in case parent refuses the change
288
288
// see: https://github.com/ElemeFE/element/issues/12850
289
289
this .$nextTick (() => {
290
- let input = this .$refs . input || this . $refs . textarea ;
290
+ let input = this .getInput () ;
291
291
input .value = this .value ;
292
292
});
293
293
},
325
325
this .$emit (' input' , ' ' );
326
326
this .$emit (' change' , ' ' );
327
327
this .$emit (' clear' );
328
+ },
329
+ getInput () {
330
+ return this .$refs .input || this .$refs .textarea ;
328
331
}
329
332
},
330
333
You can’t perform that action at this time.
0 commit comments