mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
feat(multi-select): forward "on:clear" event
This commit is contained in:
parent
956b316009
commit
a016bf897c
3 changed files with 23 additions and 11 deletions
|
@ -2749,6 +2749,7 @@ No slots.
|
|||
|
||||
### Forwarded events
|
||||
|
||||
- `on:clear`
|
||||
- `on:keydown`
|
||||
- `on:focus`
|
||||
- `on:blur`
|
||||
|
|
|
@ -8051,11 +8051,22 @@
|
|||
],
|
||||
"slots": [],
|
||||
"forwarded_events": [
|
||||
[
|
||||
"clear",
|
||||
{
|
||||
"start": 8393,
|
||||
"end": 8401,
|
||||
"type": "EventHandler",
|
||||
"name": "clear",
|
||||
"modifiers": [],
|
||||
"expression": null
|
||||
}
|
||||
],
|
||||
[
|
||||
"keydown",
|
||||
{
|
||||
"start": 9267,
|
||||
"end": 9277,
|
||||
"start": 9289,
|
||||
"end": 9299,
|
||||
"type": "EventHandler",
|
||||
"name": "keydown",
|
||||
"modifiers": [],
|
||||
|
@ -8065,8 +8076,8 @@
|
|||
[
|
||||
"focus",
|
||||
{
|
||||
"start": 9769,
|
||||
"end": 9777,
|
||||
"start": 9791,
|
||||
"end": 9799,
|
||||
"type": "EventHandler",
|
||||
"name": "focus",
|
||||
"modifiers": [],
|
||||
|
@ -8076,8 +8087,8 @@
|
|||
[
|
||||
"blur",
|
||||
{
|
||||
"start": 9788,
|
||||
"end": 9795,
|
||||
"start": 9810,
|
||||
"end": 9817,
|
||||
"type": "EventHandler",
|
||||
"name": "blur",
|
||||
"modifiers": [],
|
||||
|
|
|
@ -169,11 +169,10 @@
|
|||
let fieldRef = null;
|
||||
let selectionRef = null;
|
||||
let inputRef = null;
|
||||
|
||||
$: inputValue = "";
|
||||
$: initialSorted = false;
|
||||
$: highlightedIndex = -1;
|
||||
$: prevChecked = [];
|
||||
let inputValue = "";
|
||||
let initialSorted = false;
|
||||
let highlightedIndex = -1;
|
||||
let prevChecked = [];
|
||||
|
||||
setContext("MultiSelect", {
|
||||
declareRef: ({ key, ref }) => {
|
||||
|
@ -335,6 +334,7 @@
|
|||
{#if checked.length > 0}
|
||||
<ListBoxSelection
|
||||
selectionCount="{checked.length}"
|
||||
on:clear
|
||||
on:clear="{() => {
|
||||
sortedItems = sortedItems.map((item) => ({
|
||||
...item,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue