🐛 Styling variables are changed to frequently sometimes

This commit is contained in:
Meierschlumpf
2023-01-06 23:54:00 +01:00
parent d26128af0e
commit 81256d1098

View File

@@ -81,12 +81,15 @@ export const useGridstack = (
useEffect(() => {
const widgetWidth = mainAreaWidth / wrapperColumnCount;
// widget width is used to define sizes of gridstack items within global.scss
// TODO: improve
root.style.setProperty('--gridstack-widget-width', widgetWidth.toString());
root.style.setProperty('--gridstack-column-count', wrapperColumnCount.toString());
gridRef.current?.cellHeight(widgetWidth);
}, [mainAreaWidth, wrapperColumnCount]);
useEffect(() => {
// column count is used to define count of columns of gridstack within global.scss
root.style.setProperty('--gridstack-column-count', wrapperColumnCount.toString());
}, [wrapperColumnCount]);
const onChange = isEditMode
? (changedNode: GridStackNode) => {
if (!configName) return;