fix(button): prevent scrolling when repeating space key

This commit is contained in:
Mathieu Puech 2020-06-23 13:29:44 -04:00
parent a217b8a128
commit 7eec6f3765

View file

@ -235,6 +235,9 @@ export class LionButton extends DisabledWithTabIndexMixin(SlotMixin(LitElement))
__keydownHandler(e) { __keydownHandler(e) {
if (this.active || !isKeyboardClickEvent(e)) { if (this.active || !isKeyboardClickEvent(e)) {
if (isSpaceKeyboardClickEvent(e)) {
e.preventDefault();
}
return; return;
} }