Skip to content

Commit 645f36d

Browse files
committed
one more update
1 parent 5c11a46 commit 645f36d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/material/datepicker/date-range-input-parts.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,9 @@ export class MatStartDate<D> extends _MatDateRangeInputBase<D> implements CanUpd
304304
event.preventDefault();
305305
endInput._elementRef.nativeElement.setSelectionRange(0, 0);
306306
endInput.focus();
307+
} else {
308+
super._onKeydown(event);
307309
}
308-
309-
super._onKeydown(event);
310310
}
311311
}
312312

@@ -402,10 +402,9 @@ export class MatEndDate<D> extends _MatDateRangeInputBase<D> implements CanUpdat
402402
if (event.keyCode === BACKSPACE && !element.value) {
403403
startInput.focus();
404404
}
405-
406405
// If the user hits LEFT (LTR) when at the start of the input (and no
407406
// selection), move the cursor to the end of the start input.
408-
if (
407+
else if (
409408
((event.keyCode === LEFT_ARROW && isLtr) || (event.keyCode === RIGHT_ARROW && !isLtr)) &&
410409
element.selectionStart === 0 &&
411410
element.selectionEnd === 0
@@ -414,8 +413,8 @@ export class MatEndDate<D> extends _MatDateRangeInputBase<D> implements CanUpdat
414413
const endPosition = startInput._elementRef.nativeElement.value.length;
415414
startInput._elementRef.nativeElement.setSelectionRange(endPosition, endPosition);
416415
startInput.focus();
416+
} else {
417+
super._onKeydown(event);
417418
}
418-
419-
super._onKeydown(event);
420419
}
421420
}

0 commit comments

Comments
 (0)