From 60862650f3de091860859f9636bdbebfd8d914d8 Mon Sep 17 00:00:00 2001 From: jorenbroekema Date: Wed, 21 Jul 2021 13:19:33 +0200 Subject: [PATCH] fix(input-stepper): redispatch btn blurs on stepper --- .changeset/tender-kangaroos-visit.md | 5 ++++ .../input-stepper/src/LionInputStepper.js | 17 ++++++++++++ .../test/lion-input-stepper.test.js | 26 +++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 .changeset/tender-kangaroos-visit.md diff --git a/.changeset/tender-kangaroos-visit.md b/.changeset/tender-kangaroos-visit.md new file mode 100644 index 000000000..6e56dbdf3 --- /dev/null +++ b/.changeset/tender-kangaroos-visit.md @@ -0,0 +1,5 @@ +--- +'@lion/input-stepper': patch +--- + +Redispatch leave events on input-stepper when leaving the increment/decrement buttons. This will consider entering and leaving the buttons as user interactions and result in the input-stepper "touched" property to be set to true, similar to when you would enter/leave the input field. diff --git a/packages/input-stepper/src/LionInputStepper.js b/packages/input-stepper/src/LionInputStepper.js index 9cf0153a2..8eed0cbaf 100644 --- a/packages/input-stepper/src/LionInputStepper.js +++ b/packages/input-stepper/src/LionInputStepper.js @@ -67,6 +67,7 @@ export class LionInputStepper extends LionInput { this.__increment = this.__increment.bind(this); this.__decrement = this.__decrement.bind(this); + this.__boundOnLeaveButton = this._onLeaveButton.bind(this); } connectedCallback() { @@ -299,6 +300,7 @@ export class LionInputStepper extends LionInput {