File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed
Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1212 @close =" closeMenu"
1313 @focus =" handleInputFocus"
1414 @blur =" handleBlur"
15- @real-blur =" isInputFocused = false"
15+ @real-blur =" setState(' isInputFocused', false) "
1616 >
1717 <template v-for =" (slot , i ) in inputSlots " #[slot ]=" args " :key =" i " >
1818 <slot :name =" slot" v-bind =" args" />
127127 const pickerWrapperRef = useTemplateRef (' picker-wrapper' );
128128 const menuArrowRef = useTemplateRef (' menu-arrow' );
129129
130- const isInputFocused = ref (false );
131130 const shouldFocusNext = ref (false );
132131 const shiftKeyActive = ref (false );
133132 const collapse = ref (false );
397396
398397 const handleInputFocus = () => {
399398 if (textInput .value .enabled ) {
400- isInputFocused . value = true ;
399+ setState ( ' isInputFocused' , true ) ;
401400 formatInputValue ();
402401 }
403402
406405
407406 const handleBlur = () => {
408407 if (textInput .value .enabled ) {
409- isInputFocused . value = false ;
408+ setState ( ' isInputFocused' , false ) ;
410409 parseExternalModelValue (rootProps .modelValue );
411410 if (shouldFocusNext .value ) {
412411 const el = findNextFocusableElement (pickerWrapperRef .value ! , shiftKeyActive .value );
Original file line number Diff line number Diff line change @@ -135,9 +135,9 @@ export const useDefaults = (props: RootPropsWithDefaults) => {
135135 if ( typeof props . textInput === 'object' ) {
136136 return {
137137 ...defaultTextInputOptions ,
138- format : formats . value . input ,
139- pattern : formats . value . input ,
140138 ...props . textInput ,
139+ format : typeof props . textInput . format === 'string' ? props . textInput . format : formats . value . input ,
140+ pattern : props . textInput . format ?? formats . value . input ,
141141 enabled : true ,
142142 } ;
143143 }
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ export interface TextInputConfig {
120120 rangeSeparator : string ;
121121 selectOnFocus : boolean ;
122122 escClose : boolean ;
123- format : string ;
123+ format : string | string [ ] | ( ( value : string ) => Date | null ) ;
124124 maskFormat : string ;
125125}
126126
You can’t perform that action at this time.
0 commit comments