fix(multi-select): ListBoxField should not prevent default keyboard behavior (#1101)

Fixes #938
This commit is contained in:
metonym 2022-02-18 15:54:00 -08:00 committed by GitHub
commit 73b105660c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -60,7 +60,7 @@
on:mouseover on:mouseover
on:mouseenter on:mouseenter
on:mouseleave on:mouseleave
on:keydown|preventDefault|stopPropagation on:keydown|stopPropagation
on:focus on:focus
on:blur on:blur
> >

View file

@ -315,10 +315,14 @@
open = !open; open = !open;
} }
}}" }}"
on:keydown="{({ key }) => { on:keydown="{(e) => {
if (filterable) { if (filterable) {
return; return;
} }
const key = e.key;
if ([' ', 'ArrowUp', 'ArrowDown'].includes(key)) {
e.preventDefault();
}
if (key === ' ') { if (key === ' ') {
open = !open; open = !open;
} else if (key === 'Tab') { } else if (key === 'Tab') {