From 95af9bf570c21af07c44ba5a5ee8cb17eeb45305 Mon Sep 17 00:00:00 2001 From: Stoyan Date: Mon, 16 Feb 2026 16:11:14 +0200 Subject: [PATCH 1/2] fix(ui5-time-picker): apply AM/PM selection on Enter key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Overview When selecting AM/PM from the SegmentedButton using the Enter key, the picker closed but the value was not updated. ## What We Did - Added period change handling before closing the picker when Enter is pressed on the AM/PM SegmentedButton ## What This Fixes - ✅ Pressing Enter on AM/PM SegmentedButton now correctly updates the time value - ✅ No functional changes to other keyboard interactions --- packages/main/src/TimeSelectionClocks.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/main/src/TimeSelectionClocks.ts b/packages/main/src/TimeSelectionClocks.ts index a0b9118ba107..f0932f597eac 100644 --- a/packages/main/src/TimeSelectionClocks.ts +++ b/packages/main/src/TimeSelectionClocks.ts @@ -173,6 +173,14 @@ class TimeSelectionClocks extends TimePickerInternals { const toggleSpinButtonTarget = evt.target && (evt.target as HTMLElement).tagName.toLowerCase().indexOf("segmented") === -1; if (isEnter(evt)) { + // If Enter is pressed on AM/PM segmented button, apply the period change first + if (this._amPmFocused) { + const buttonAmPm = this._buttonAmPm(); + const selectedItem = buttonAmPm?.items.find(item => item.selected); + if (selectedItem?.textContent) { + this._calculatePeriodChange(selectedItem.textContent); + } + } // Accept the time and close the popover this.fireDecoratorEvent("close-picker"); } else if (isSpace(evt) && toggleSpinButtonTarget && !this._spacePressed) { From 59ea4b7067ba6ccb68da6fa70ef826da058fc875 Mon Sep 17 00:00:00 2001 From: Stoyan Date: Fri, 27 Feb 2026 09:59:55 +0200 Subject: [PATCH 2/2] use segmented button getter --- packages/main/src/TimeSelectionClocks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/main/src/TimeSelectionClocks.ts b/packages/main/src/TimeSelectionClocks.ts index f0932f597eac..9ab39f1922a9 100644 --- a/packages/main/src/TimeSelectionClocks.ts +++ b/packages/main/src/TimeSelectionClocks.ts @@ -176,7 +176,7 @@ class TimeSelectionClocks extends TimePickerInternals { // If Enter is pressed on AM/PM segmented button, apply the period change first if (this._amPmFocused) { const buttonAmPm = this._buttonAmPm(); - const selectedItem = buttonAmPm?.items.find(item => item.selected); + const selectedItem = buttonAmPm?.selectedItems[0]; if (selectedItem?.textContent) { this._calculatePeriodChange(selectedItem.textContent); }