Skip to content

Commit 1e0eefb

Browse files
authored
Merge pull request #3943 from James-Baloyi/james/b/69774
fix bug in isNullOrWhiteSpace utility
2 parents 39d5eca + 838387b commit 1e0eefb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

shesha-reactjs/src/designer-components/numberField/numberField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const NumberFieldComponent: IToolboxComponent<INumberFieldComponentProps, INumbe
9191
const customEvents = calculatedModel.eventHandlers;
9292
const onChangeInternal = (val: number | string | null): void => {
9393
const newValue = val !== undefined && val !== null && model.highPrecision
94-
? parseInt(val + '', 10)
94+
? (typeof val === 'string' ? parseFloat(val) : val)
9595
: val;
9696
customEvents.onChange(newValue);
9797
onChange(newValue);

shesha-reactjs/src/utils/nullables.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const isDefined = <T>(value: T | null | undefined): value is NonNullable<
88
* @returns True if the string is null or white space, false otherwise.
99
*/
1010
export const isNullOrWhiteSpace = (value: string | null | undefined): value is null | undefined => {
11-
return value === null || value === undefined || value.trim() === '';
11+
return value === null || value === undefined || (typeof value === 'string' && value.trim() === '');
1212
};
1313

1414
/**

0 commit comments

Comments
 (0)