mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 03:49:34 +00:00
fix(combo-box): prevent default when pressing "Enter," "ArrowDown," or "ArrowUp"
This commit is contained in:
parent
740c8e1596
commit
d66dc57233
1 changed files with 5 additions and 1 deletions
|
@ -284,7 +284,11 @@
|
||||||
}
|
}
|
||||||
}}"
|
}}"
|
||||||
on:keydown
|
on:keydown
|
||||||
on:keydown|stopPropagation="{({ key }) => {
|
on:keydown|stopPropagation="{(e) => {
|
||||||
|
const { key } = e;
|
||||||
|
if (['Enter', 'ArrowDown', 'ArrowUp'].includes(key)) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
if (key === 'Enter') {
|
if (key === 'Enter') {
|
||||||
open = !open;
|
open = !open;
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue