From 7eec6f37651d16cc94f77d86f891d19137cfd427 Mon Sep 17 00:00:00 2001 From: Mathieu Puech Date: Tue, 23 Jun 2020 13:29:44 -0400 Subject: [PATCH] fix(button): prevent scrolling when repeating space key --- packages/button/src/LionButton.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/button/src/LionButton.js b/packages/button/src/LionButton.js index 69b4f7de5..74070d5de 100644 --- a/packages/button/src/LionButton.js +++ b/packages/button/src/LionButton.js @@ -235,6 +235,9 @@ export class LionButton extends DisabledWithTabIndexMixin(SlotMixin(LitElement)) __keydownHandler(e) { if (this.active || !isKeyboardClickEvent(e)) { + if (isSpaceKeyboardClickEvent(e)) { + e.preventDefault(); + } return; }