mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
fix: pressing "Escape" should close Dropdown
, MultiSelect
menu (#1473)
* fix(dropdown): close the menu when pressing "Escape" * fix(multi-select): close the menu when pressing "Escape"
This commit is contained in:
parent
1a7f750093
commit
855ee06741
2 changed files with 4 additions and 0 deletions
|
@ -236,6 +236,8 @@
|
||||||
change(1);
|
change(1);
|
||||||
} else if (key === 'ArrowUp') {
|
} else if (key === 'ArrowUp') {
|
||||||
change(-1);
|
change(-1);
|
||||||
|
} else if (key === 'Escape') {
|
||||||
|
open = false;
|
||||||
}
|
}
|
||||||
}}"
|
}}"
|
||||||
disabled="{disabled}"
|
disabled="{disabled}"
|
||||||
|
|
|
@ -368,6 +368,8 @@
|
||||||
return { ...item, checked: !item.checked };
|
return { ...item, checked: !item.checked };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} else if (key === 'Escape') {
|
||||||
|
open = false;
|
||||||
}
|
}
|
||||||
}}"
|
}}"
|
||||||
on:focus="{() => {
|
on:focus="{() => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue