mirror of
https://github.com/ajnart/homarr.git
synced 2026-01-28 10:19:13 +01:00
🐛 Issue with moving items arround with change-position-modal
This commit is contained in:
@@ -11,8 +11,6 @@ const GridstackContext = createContext<GridstackContextProps>({
|
||||
|
||||
export const useGridstackRef = () => {
|
||||
const ctx = useContext(GridstackContext);
|
||||
if (!ctx || !ctx.ref)
|
||||
throw new Error('useGridstackContext must be used within a GridstackProvider');
|
||||
return ctx.ref;
|
||||
};
|
||||
|
||||
|
||||
@@ -13,12 +13,10 @@ export const useResizeGridItem = () => {
|
||||
const gridstackRef = useGridstackRef();
|
||||
|
||||
return ({ height, width, ...options }: ResizeGridItemProps) => {
|
||||
gridstackRef.current?.batchUpdate();
|
||||
gridstackRef.current?.update(itemRef.current!, {
|
||||
gridstackRef?.current?.update(itemRef.current!, {
|
||||
...options,
|
||||
h: height,
|
||||
w: width,
|
||||
});
|
||||
gridstackRef.current?.batchUpdate(false);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user