feat(data-table): hide batch actions if overflow visible

This commit is contained in:
Eric Liu 2020-10-26 08:15:31 -07:00
commit a2b375f32e
8 changed files with 104 additions and 48 deletions

View file

@ -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>