add basic mobile responsive layout

This commit is contained in:
jeffvli
2025-11-19 19:23:44 -08:00
parent 485fe8085c
commit c763824803
26 changed files with 1930 additions and 40 deletions
@@ -290,7 +290,7 @@ export const ItemGridList = ({
const internalState = useItemListState(getDataFn, extractRowId);
const [initialize] = useOverlayScrollbars({
const [initialize, osInstance] = useOverlayScrollbars({
defer: false,
events: {
initialized(osInstance) {
@@ -323,15 +323,39 @@ export const ItemGridList = ({
const { current: root } = rootRef;
const { current: outer } = outerRef;
if (root && outer) {
initialize({
elements: {
viewport: outer,
},
target: root,
});
if (!tableMeta || !root || !outer) {
return;
}
}, [initialize, tableMeta]);
initialize({
elements: {
viewport: outer,
},
target: root,
});
return () => {
try {
const instance = osInstance();
const { current: root } = rootRef;
const { current: outer } = outerRef;
// Check if instance exists and elements are still connected to the DOM
if (instance) {
// Check if elements are still in the document
const rootInDocument = root && document.contains(root);
const outerInDocument = outer && document.contains(outer);
// Only destroy if elements are still in the document
if (rootInDocument && outerInDocument) {
instance.destroy();
}
}
} catch {
// Ignore error
}
};
}, [initialize, osInstance, tableMeta]);
const throttledSetTableMeta = useMemo(() => {
return createThrottledSetTableMeta(itemsPerRow, rows?.length);