mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 20:33:02 +00:00
fix(tabs): dispatch change event in update/change context methods
This commit is contained in:
parent
7f1b250df5
commit
51ede6df8f
1 changed files with 3 additions and 4 deletions
|
@ -46,10 +46,8 @@
|
||||||
content.update((_) => [..._, { ...data, index: _.length }]);
|
content.update((_) => [..._, { ...data, index: _.length }]);
|
||||||
},
|
},
|
||||||
update: (id) => {
|
update: (id) => {
|
||||||
if (currentIndex !== $tabsById[id].index) {
|
currentIndex = $tabsById[id].index;
|
||||||
currentIndex = $tabsById[id].index;
|
dispatch("change", currentIndex);
|
||||||
dispatch("change", currentIndex);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
change: (direction) => {
|
change: (direction) => {
|
||||||
let index = currentIndex + direction;
|
let index = currentIndex + direction;
|
||||||
|
@ -75,6 +73,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
currentIndex = index;
|
currentIndex = index;
|
||||||
|
dispatch("change", currentIndex);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue