🐛 Styling variables are changed to frequently sometimes
This commit is contained in:
1 parent
d26128af0e
commit
81256d1098
1 file changed
+5
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user