Skip to content

Commit

Permalink
fix: Uncaught error when editing Number field in Edit Row dialog (par…
Browse files Browse the repository at this point in the history
  • Loading branch information
dplewis authored Mar 5, 2023
1 parent 60f9a2b commit 26bd6fa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dashboard/Data/Browser/EditRowDialog.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import ObjectPickerDialog from 'dashboard/Data/Browser/ObjectPickerDialog.react'
import styles from 'dashboard/Data/Browser/Browser.scss';
import getFileName from 'lib/getFileName';
import encode from 'parse/lib/browser/encode';
import validateNumeric from 'lib/validateNumeric';

export default class EditRowDialog extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -291,8 +292,8 @@ export default class EditRowDialog extends React.Component {
disabled={isDisabled}
value={currentObject[name]}
placeholder={val === undefined ? '(undefined)' : ''}
onChange={newValue => this.updateCurrentObject(newValue, name)}
onBlur={newValue => this.handleChange(parseFloat(newValue), name)}
onChange={newValue => this.updateCurrentObject(validateNumeric(newValue) ? newValue : currentObject[name], name)}
onBlur={newValue => this.handleChange(validateNumeric(parseFloat(newValue)) ? parseFloat(newValue) : undefined, name)}
/>
);
break;
Expand Down

0 comments on commit 26bd6fa

Please sign in to comment.