From 02d0106a069fcf9e420d5875be1dac302a3223b3 Mon Sep 17 00:00:00 2001 From: gerjanvangeest Date: Thu, 4 Sep 2025 14:28:54 +0200 Subject: [PATCH] fix(input-stepper): make decrement and increment functions protected instead of private (#2568) --- .changeset/perfect-suits-dream.md | 5 +++++ .../input-stepper/src/LionInputStepper.js | 20 +++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 .changeset/perfect-suits-dream.md diff --git a/.changeset/perfect-suits-dream.md b/.changeset/perfect-suits-dream.md new file mode 100644 index 000000000..ac1e3dbed --- /dev/null +++ b/.changeset/perfect-suits-dream.md @@ -0,0 +1,5 @@ +--- +'@lion/ui': patch +--- + +[input-stepper] make decrement and increment functions protected instead of private diff --git a/packages/ui/components/input-stepper/src/LionInputStepper.js b/packages/ui/components/input-stepper/src/LionInputStepper.js index ebc0fe6ad..aeab9712a 100644 --- a/packages/ui/components/input-stepper/src/LionInputStepper.js +++ b/packages/ui/components/input-stepper/src/LionInputStepper.js @@ -94,8 +94,8 @@ export class LionInputStepper extends LocalizeMixin(LionInput) { step: this.step, }; - this.__increment = this.__increment.bind(this); - this.__decrement = this.__decrement.bind(this); + this._increment = this._increment.bind(this); + this._decrement = this._decrement.bind(this); this._onEnterButton = this._onEnterButton.bind(this); this._onLeaveButton = this._onLeaveButton.bind(this); } @@ -192,11 +192,11 @@ export class LionInputStepper extends LocalizeMixin(LionInput) { */ __keyDownHandler(ev) { if (ev.key === 'ArrowUp') { - this.__increment(); + this._increment(); } if (ev.key === 'ArrowDown') { - this.__decrement(); + this._decrement(); } } @@ -262,9 +262,9 @@ export class LionInputStepper extends LocalizeMixin(LionInput) { /** * Increment the value based on given step or default step value is 1 - * @private + * @protected */ - __increment() { + _increment() { const { step, min, max } = this.values; const stepMin = min !== Infinity ? min : 0; @@ -284,9 +284,9 @@ export class LionInputStepper extends LocalizeMixin(LionInput) { /** * Decrement the value based on given step or default step value is 1 - * @private + * @protected */ - __decrement() { + _decrement() { const { step, max, min } = this.values; const stepMin = min !== Infinity ? min : 0; @@ -379,7 +379,7 @@ export class LionInputStepper extends LocalizeMixin(LionInput) { return html`