Skip to content

Commit

Permalink
update floatEditor input logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jguevarra committed Aug 31, 2023
1 parent 171e70c commit e94022e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/gridCellEditors/floatEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ const FloatEditor = forwardRef(({
}, ref) => {
const [selectedValue, setSelectedValue] = useState(value);

const setTest = e => {
const setValue = e => {
setSelectedValue(e.target.value);
};

useImperativeHandle(ref, () => ({
getValue: () => parseFloat(selectedValue) ? parseFloat(selectedValue) : 0,
isCancelBeforeStart: () => false,
}));
return (<Input value={parseFloat(selectedValue) !== undefined && parseFloat(selectedValue) !== null ? parseFloat(selectedValue) : ''} type='number' onChange={setTest} isRequired={isRequired} />);
return (<Input value={selectedValue ? selectedValue : ''} type='number' onChange={setValue} isRequired={isRequired} />);
});

export default FloatEditor;

0 comments on commit e94022e

Please sign in to comment.