File tree 3 files changed +20
-3
lines changed
3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -533,6 +533,11 @@ export default defineComponent({
533
533
}
534
534
return placeholderStr ;
535
535
} ,
536
+ handleTInputFocus ( ) {
537
+ // TODO: 待改成select-input后删除
538
+ // hack 在input聚焦时马上blur 避免出现输入光标
539
+ ( this . $refs . native as HTMLInputElement ) . blur ( ) ;
540
+ } ,
536
541
} ,
537
542
render ( ) {
538
543
// props
@@ -655,7 +660,6 @@ export default defineComponent({
655
660
disabled = { disabled }
656
661
clearable = { clearable }
657
662
placeholder = { this . getPlaceholderText ( ) }
658
- readonly = { ! allowInput }
659
663
allowInput = { allowInput ? 1 : 0 }
660
664
size = { size }
661
665
inputProps = { inputProps }
@@ -668,6 +672,7 @@ export default defineComponent({
668
672
click = { this . onClick }
669
673
suffixIcon = { suffixIcon }
670
674
prefixIcon = { prefixIcon }
675
+ onFocus = { this . handleTInputFocus }
671
676
/>
672
677
</ div >
673
678
</ t-popup >
Original file line number Diff line number Diff line change @@ -299,6 +299,11 @@ export default defineComponent({
299
299
emitEvent ( this , 'change' , undefined ) ;
300
300
e . stopPropagation ( ) ;
301
301
} ,
302
+ handleTInputFocus ( ) {
303
+ // TODO: 待改成select-input后删除
304
+ // hack 在input聚焦时马上blur 避免出现输入光标
305
+ ( this . $refs . tInput as HTMLInputElement ) . blur ( ) ;
306
+ } ,
302
307
renderInput ( ) {
303
308
const classes = [
304
309
`${ this . COMPONENT_NAME } __group` ,
@@ -317,11 +322,12 @@ export default defineComponent({
317
322
size = { this . size }
318
323
onClear = { this . clear }
319
324
clearable = { this . clearable }
320
- readonly
321
325
placeholder = " "
322
326
value = { this . time ? ' ' : undefined }
323
327
class = { this . isShowPanel ? this . STATUS . focused : '' }
324
328
v-slots = { slots }
329
+ ref = "tInput"
330
+ onFocus = { this . handleTInputFocus }
325
331
> </ t-input >
326
332
< input-items
327
333
size = { this . size }
Original file line number Diff line number Diff line change @@ -257,6 +257,11 @@ export default defineComponent({
257
257
emitEvent ( this , 'change' , values ) ;
258
258
isFunction ( this . onChange ) && this . onChange ( values ) ;
259
259
} ,
260
+ handleTInputFocus ( ) {
261
+ // TODO: 待改成select-input后删除
262
+ // hack 在input聚焦时马上blur 避免出现输入光标
263
+ ( this . $refs . tInput as HTMLInputElement ) . blur ( ) ;
264
+ } ,
260
265
renderInput ( ) {
261
266
const classes = [
262
267
`${ this . COMPONENT_NAME } __group` ,
@@ -272,8 +277,9 @@ export default defineComponent({
272
277
onClear = { this . clear }
273
278
clearable = { this . clearable }
274
279
placeholder = " "
275
- readonly
276
280
value = { ! isEqual ( this . time , TIME_PICKER_EMPTY ) ? ' ' : undefined }
281
+ ref = "tInput"
282
+ onFocus = { this . handleTInputFocus }
277
283
>
278
284
< time-icon slot = "suffix-icon" > </ time-icon >
279
285
</ t-input >
You can’t perform that action at this time.
0 commit comments