File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed
Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change @@ -269,18 +269,11 @@ export class DatePicker implements
269269 // This makes sure that the `flatpickrInstance selectedDates` are in sync with the values of
270270 // the inputs when the calendar closes.
271271 if ( this . range && this . flatpickrInstance ) {
272- if ( this . flatpickrInstance . selectedDates . length !== 2 ) {
273- // we could `this.flatpickrInstance.clear()` but it insists on opening the second picker
274- // in some cases, so instead we do this
275- this . setDateValues ( [ ] ) ;
276- this . doSelect ( [ ] ) ;
277- return ;
278- }
279272 const inputValue = this . input . input . nativeElement . value ;
280273 const rangeInputValue = this . rangeInput . input . nativeElement . value ;
281274 if ( inputValue || rangeInputValue ) {
282275 const parseDate = ( date : string ) => this . flatpickrInstance . parseDate ( date , this . dateFormat ) ;
283- this . setDateValues ( [ parseDate ( inputValue ) , parseDate ( rangeInputValue ) ] ) ;
276+ this . setDateValues ( [ parseDate ( inputValue ) , parseDate ( rangeInputValue || inputValue ) ] ) ;
284277 this . doSelect ( this . flatpickrInstance . selectedDates ) ;
285278 }
286279 }
You can’t perform that action at this time.
0 commit comments