fix: webui table horizontal scroll
@@ -13,14 +13,14 @@ const ResponsiveTable: ResponsiveTable = ({ scroll, ...props }) => {
const resize = useResize(tableRef);
useEffect(() => {
- if (!tableRef.current) return;
+ if (!tableRef.current || resize.width === 0) return;
const tables = tableRef.current.getElementsByTagName('table');
if (tables.length === 0) return;
const rect = tables[0].getBoundingClientRect();
setTableScroll({
- x: rect.width > resize.width ? rect.width : scroll?.x,
+ x: rect.width > resize.width ? rect.width : 'max-content',
y: scroll?.y,
});
}, [ resize, scroll ]);
