Skip to content

Commit 10cab8b

Browse files
committed
fix(#54): handle empty value in isStringNumber function
1 parent 8405ed6 commit 10cab8b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/src/hooks/useViewControl.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export function useViewControl({ props, cminstance, presetRef }: UseViewControlP
2525
};
2626

2727
const isStringNumber = (value?: string | number | null) => {
28+
if (!value) return false;
2829
return value && isNaN(+value) ? false : true;
2930
};
3031

0 commit comments

Comments
 (0)