bvaughn/react-devtools-experimental

Props editor hard to enter negative number

samdenty opened this issue · 1 comments

If you select all on a number prop and try to type in a negative value, it won't allow you.

You have to type the number in first, then add a negative sign.

Hm... that's because we are currently parsing the value to ensure it stays a number:

} else if (dataType === 'number') {
setEditableValue(parseFloat(target.value));

I suppose we could delay that conversion (string -> number) until/unless the changed value was actually applied:

if (key === 'Enter') {
overrideValueFn(path, editableValue);