File tree 5 files changed +16
-8
lines changed
5 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 38
38
:no-overlay-focus =" noOverlayFocus"
39
39
:collapse =" collapse"
40
40
:get-input-rect =" getInputRect"
41
+ :is-text-input-date =" isTextInputDate"
41
42
@close-picker =" closeMenu"
42
43
@select-date =" selectDate"
43
44
@auto-apply =" autoApplyValue"
157
158
const shouldFocusNext = ref (false );
158
159
const shiftKeyActive = ref (false );
159
160
const collapse = ref (false );
161
+ const isTextInputDate = ref (false );
160
162
161
163
const { setMenuFocused, setShiftKey } = useState ();
162
164
const { clearArrowNav } = useArrowNavigation ();
447
449
const validDate = Array .isArray (date ) ? ! date .some ((d ) => ! validateDate (d )) : validateDate (date );
448
450
const validTime = isValidTime (date );
449
451
if (validDate && validTime ) {
452
+ isTextInputDate .value = true ;
450
453
internalModelValue .value = date ;
451
454
if (submit ) {
452
455
shouldFocusNext .value = tabbed ;
453
456
selectDate ();
454
457
emit (' text-submit' );
455
458
}
459
+ nextTick ().then (() => {
460
+ isTextInputDate .value = false ;
461
+ });
456
462
}
457
463
};
458
464
Original file line number Diff line number Diff line change 177
177
);
178
178
179
179
watch (
180
- defaultedMultiCalendars ,
181
- (newVal , oldVal ) => {
182
- if (newVal .count - oldVal .count > 0 ) {
183
- assignMonthAndYear ();
184
- }
185
- },
186
- { deep: true },
180
+ defaultedMultiCalendars ,
181
+ (newVal , oldVal ) => {
182
+ if (newVal .count - oldVal .count > 0 ) {
183
+ assignMonthAndYear ();
184
+ }
185
+ },
186
+ { deep: true },
187
187
);
188
188
189
189
/**
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ export const useDatePicker = (
107
107
modelValue ,
108
108
( newVal , oldVal ) => {
109
109
if ( JSON . stringify ( newVal ) !== JSON . stringify ( oldVal ) ) {
110
- mapInternalModuleValues ( ) ;
110
+ mapInternalModuleValues ( props . isTextInputDate ) ;
111
111
}
112
112
} ,
113
113
{ deep : true } ,
Original file line number Diff line number Diff line change 172
172
noOverlayFocus: { type: Boolean as PropType <boolean >, default: false },
173
173
collapse: { type: Boolean as PropType <boolean >, default: false },
174
174
getInputRect: { type: Function as PropType <() => DOMRect >, default : () => ({}) },
175
+ isTextInputDate: { type: Boolean as PropType <boolean >, default: false },
175
176
});
176
177
177
178
const dpMenuRef = ref <HTMLElement | null >(null );
Original file line number Diff line number Diff line change @@ -181,6 +181,7 @@ export const PickerBaseProps = {
181
181
collapse : { type : Boolean as PropType < boolean > , default : false } ,
182
182
menuWrapRef : { type : Object as PropType < HTMLElement | null > , default : null } ,
183
183
getInputRect : { type : Function as PropType < ( ) => DOMRect > , default : ( ) => ( { } ) } ,
184
+ isTextInputDate : { type : Boolean as PropType < boolean > , default : false } ,
184
185
} ;
185
186
186
187
export type AllPropsType = ExtractPropTypes < typeof AllProps > ;
You can’t perform that action at this time.
0 commit comments