Merge pull request #784 from MathieuPuech/fix/button-space-scroll

fix(button): prevent scrolling when repeating space key
This commit is contained in:
gerjanvangeest 2020-06-24 08:50:30 +02:00 committed by GitHub
commit 38df686ff5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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