From 8902a2a7b0ff60070b9949ff80de0f1c976b61f3 Mon Sep 17 00:00:00 2001 From: Nikolay Hristov Date: Wed, 15 Apr 2026 16:54:48 +0300 Subject: [PATCH 1/2] fix(ui5-step-input): adjust z-index and fix focus issues --- packages/main/src/StepInput.ts | 22 +++++++++++++++------- packages/main/src/themes/StepInput.css | 3 ++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/packages/main/src/StepInput.ts b/packages/main/src/StepInput.ts index 89b58e949447..9e27161df172 100644 --- a/packages/main/src/StepInput.ts +++ b/packages/main/src/StepInput.ts @@ -483,7 +483,7 @@ class StepInput extends UI5Element implements IFormInputElement { _onButtonFocusOut() { setTimeout(() => { - if (!this._inputFocused) { + if (!this._inputFocused && !this.shadowRoot!.querySelector(":focus")) { this.inputOuter.removeAttribute("focused"); } }, 0); @@ -507,13 +507,11 @@ class StepInput extends UI5Element implements IFormInputElement { } _onMouseWheel(e: WheelEvent) { - if (this.disabled || this.readonly) { + if (this.disabled || this.readonly || !this._isFocused) { return; } - if (this._isFocused) { - e.preventDefault(); - } + e.preventDefault(); const isScrollUp = e.deltaY < 0; const modifier = isScrollUp ? this.step : -this.step; @@ -767,15 +765,25 @@ class StepInput extends UI5Element implements IFormInputElement { return !Number.isNaN(parsedValue) && !/, {2,}/.test(typedValue); } - _decSpin() { + _decSpin(e: MouseEvent) { + if (this._isFocused || this._decIconDisabled) { + e.preventDefault(); + } if (!this._decIconDisabled) { this._spinValue(false, true); + } else { + this.input.focus(); } } - _incSpin() { + _incSpin(e: MouseEvent) { + if (this._isFocused || this._incIconDisabled) { + e.preventDefault(); + } if (!this._incIconDisabled) { this._spinValue(true, true); + } else { + this.input.focus(); } } diff --git a/packages/main/src/themes/StepInput.css b/packages/main/src/themes/StepInput.css index 18a3805f300a..8fad78bff4bf 100644 --- a/packages/main/src/themes/StepInput.css +++ b/packages/main/src/themes/StepInput.css @@ -18,6 +18,7 @@ box-sizing: border-box; height: var(--_ui5_input_height); position: relative; + isolation: isolate; margin: var(--_ui5_input_margin_top_bottom) 0; min-width: var(--_ui5_step_input_min_width); text-align: right; @@ -99,7 +100,7 @@ pointer-events: none; border-radius: var(--sapField_BorderCornerRadius); border-style: var(--_ui5_input_error_warning_border_style); - z-index: 1; + z-index: 0; border-width: 0px; } From 3d4cbaa0c96b1a1a3d36b0e4fd3ddd62d470f58c Mon Sep 17 00:00:00 2001 From: Nikolay Hristov Date: Thu, 16 Apr 2026 14:25:42 +0300 Subject: [PATCH 2/2] fix(ui5-step-input): fix comment --- packages/main/src/StepInput.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/main/src/StepInput.ts b/packages/main/src/StepInput.ts index 9e27161df172..e125e14433e8 100644 --- a/packages/main/src/StepInput.ts +++ b/packages/main/src/StepInput.ts @@ -483,7 +483,7 @@ class StepInput extends UI5Element implements IFormInputElement { _onButtonFocusOut() { setTimeout(() => { - if (!this._inputFocused && !this.shadowRoot!.querySelector(":focus")) { + if (!this._inputFocused && !this.shadowRoot!.activeElement) { this.inputOuter.removeAttribute("focused"); } }, 0);