Skip to content

Commit 24467f8

Browse files
authored
fix(ui5-date-picker): keyboard handling now compliant with the specification (#3636)
- Focus is moved on the component input field after closing the corresponding popover via Escape keyboard key. Fixes #3091
1 parent 7cdcb4d commit 24467f8

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

packages/main/src/DatePicker.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,8 @@ class DatePicker extends DateComponentBase {
394394
this._isPickerOpen = false;
395395
if (isPhone()) {
396396
this.blur(); // close device's keyboard and prevent further typing
397-
} else if (this._focusInputAfterClose) {
397+
} else {
398398
this._getInput().focus();
399-
this._focusInputAfterClose = false;
400399
}
401400
}
402401

@@ -710,7 +709,6 @@ class DatePicker extends DateComponentBase {
710709
const newValue = event.detail.values && event.detail.values[0];
711710
this._updateValueAndFireEvents(newValue, true, ["change", "value-changed"]);
712711

713-
this._focusInputAfterClose = true;
714712
this.closePicker();
715713
}
716714

packages/main/src/DateRangePicker.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ class DateRangePicker extends DatePicker {
223223

224224
const newValue = this._buildValue(...event.detail.dates); // the value will be normalized so we don't need to order them here
225225
this._updateValueAndFireEvents(newValue, true, ["change", "value-changed"]);
226-
this._focusInputAfterClose = true;
227226
this.closePicker();
228227
}
229228

packages/main/src/DateTimePicker.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ class DateTimePicker extends DatePicker {
369369
this.fireEvent("value-changed", { value: this.value, valid });
370370
}
371371

372-
this._focusInputAfterClose = true;
373372
this._updateValueState();
374373
this.closePicker();
375374
}

0 commit comments

Comments
 (0)