mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 11:59:34 +00:00
fix(modal): nested modals should correctly toggle the body class (#1331)
Fixes #1324
This commit is contained in:
parent
0063c01beb
commit
22f93ee675
3 changed files with 34 additions and 2 deletions
8
src/Modal/modalStore.js
Normal file
8
src/Modal/modalStore.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { writable } from "svelte/store";
|
||||
|
||||
export const modalsOpen = writable([]);
|
||||
|
||||
export const addModalId = (id) => modalsOpen.update((ids) => [...ids, id]);
|
||||
|
||||
export const removeModalId = (id) =>
|
||||
modalsOpen.update((ids) => ids.filter((_id) => _id !== id));
|
Loading…
Add table
Add a link
Reference in a new issue