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
269
269
// This makes sure that the `flatpickrInstance selectedDates` are in sync with the values of
270
270
// the inputs when the calendar closes.
271
271
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
- }
279
272
const inputValue = this . input . input . nativeElement . value ;
280
273
const rangeInputValue = this . rangeInput . input . nativeElement . value ;
281
274
if ( inputValue || rangeInputValue ) {
282
275
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 ) ] ) ;
284
277
this . doSelect ( this . flatpickrInstance . selectedDates ) ;
285
278
}
286
279
}
You can’t perform that action at this time.
0 commit comments