mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
fix(multi-select): ListBoxField should not prevent default keyboard behavior (#1101)
Fixes #938
This commit is contained in:
parent
3baa105d63
commit
73b105660c
2 changed files with 6 additions and 2 deletions
|
@ -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
|
||||||
>
|
>
|
||||||
|
|
|
@ -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') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue