mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
feat(data-table): hide batch actions if overflow visible
This commit is contained in:
parent
425a259e65
commit
a2b375f32e
8 changed files with 104 additions and 48 deletions
|
@ -6,18 +6,17 @@
|
|||
export let size = "default";
|
||||
|
||||
import { setContext } from "svelte";
|
||||
import { writable } from "svelte/store";
|
||||
|
||||
let ref = null;
|
||||
|
||||
const overflowVisible = writable(false);
|
||||
|
||||
setContext("Toolbar", {
|
||||
setOverflow: (toggled) => {
|
||||
if (ref) {
|
||||
if (toggled) {
|
||||
ref.style.overflow = "visible";
|
||||
} else {
|
||||
ref.removeAttribute("style");
|
||||
}
|
||||
}
|
||||
overflowVisible,
|
||||
setOverflowVisible: (visible) => {
|
||||
overflowVisible.set(visible);
|
||||
if (ref) ref.style.overflow = visible ? "visible" : "inherit";
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue