Skip to content

Commit 26bd6fa

Browse files
authored
fix: Uncaught error when editing Number field in Edit Row dialog (#2401)
1 parent 60f9a2b commit 26bd6fa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/dashboard/Data/Browser/EditRowDialog.react.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import ObjectPickerDialog from 'dashboard/Data/Browser/ObjectPickerDialog.react'
1414
import styles from 'dashboard/Data/Browser/Browser.scss';
1515
import getFileName from 'lib/getFileName';
1616
import encode from 'parse/lib/browser/encode';
17+
import validateNumeric from 'lib/validateNumeric';
1718

1819
export default class EditRowDialog extends React.Component {
1920
constructor(props) {
@@ -291,8 +292,8 @@ export default class EditRowDialog extends React.Component {
291292
disabled={isDisabled}
292293
value={currentObject[name]}
293294
placeholder={val === undefined ? '(undefined)' : ''}
294-
onChange={newValue => this.updateCurrentObject(newValue, name)}
295-
onBlur={newValue => this.handleChange(parseFloat(newValue), name)}
295+
onChange={newValue => this.updateCurrentObject(validateNumeric(newValue) ? newValue : currentObject[name], name)}
296+
onBlur={newValue => this.handleChange(validateNumeric(parseFloat(newValue)) ? parseFloat(newValue) : undefined, name)}
296297
/>
297298
);
298299
break;

0 commit comments

Comments
 (0)