We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d191a2 commit d60f378Copy full SHA for d60f378
src/components/Drawer/Drawer.tsx
@@ -3,6 +3,7 @@ import React from 'react';
3
import {DrawerItem, Drawer as GravityDrawer} from '@gravity-ui/navigation';
4
5
import {cn} from '../../utils/cn';
6
+import {isNumeric} from '../../utils/utils';
7
8
import {useDrawerContext} from './DrawerContext';
9
@@ -40,7 +41,7 @@ const DrawerPaneContentWrapper = ({
40
41
}: DrawerPaneContentWrapperProps) => {
42
const [drawerWidth, setDrawerWidth] = React.useState(() => {
43
const savedWidth = localStorage.getItem(storageKey);
- return savedWidth ? Number(savedWidth) : defaultWidth;
44
+ return isNumeric(savedWidth) ? Number(savedWidth) : defaultWidth;
45
});
46
47
const drawerRef = React.useRef<HTMLDivElement>(null);
0 commit comments