From ea71f6194bd8623d6f35bfdc4fabfa0209700b2a Mon Sep 17 00:00:00 2001 From: Oleksii Okadurin Date: Mon, 4 Mar 2024 09:41:28 +0100 Subject: [PATCH] fix(ui): LionInputStepper focus issue --- packages/ui/components/input-stepper/src/LionInputStepper.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/ui/components/input-stepper/src/LionInputStepper.js b/packages/ui/components/input-stepper/src/LionInputStepper.js index 26dc563cd..8895fb94e 100644 --- a/packages/ui/components/input-stepper/src/LionInputStepper.js +++ b/packages/ui/components/input-stepper/src/LionInputStepper.js @@ -196,7 +196,10 @@ export class LionInputStepper extends LocalizeMixin(LionInput) { const incrementButton = this.__getSlot('suffix'); const disableIncrementor = this.currentValue >= max && max !== Infinity; const disableDecrementor = this.currentValue <= min && min !== Infinity; - if (disableDecrementor || disableIncrementor) { + if ( + (disableDecrementor && decrementButton === document.activeElement) || + (disableIncrementor && incrementButton === document.activeElement) + ) { this._inputNode.focus(); } decrementButton[disableDecrementor ? 'setAttribute' : 'removeAttribute']('disabled', 'true');