bvaughn / react-devtools-experimental

Experimental rewrite of the React DevTools extension
https://react-devtools-experimental.now.sh
MIT License
965 stars 55 forks source link

Props editor hard to enter negative number #346

Closed samdenty closed 5 years ago

samdenty commented 5 years ago

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.

bvaughn commented 5 years ago

Hm... that's because we are currently parsing the value to ensure it stays a number: https://github.com/bvaughn/react-devtools-experimental/blob/39a811debee5a520d3a6034b429e8877e11331aa/src/devtools/views/Components/EditableValue.js#L36-L37

I suppose we could delay that conversion (string -> number) until/unless the changed value was actually applied: https://github.com/bvaughn/react-devtools-experimental/blob/39a811debee5a520d3a6034b429e8877e11331aa/src/devtools/views/Components/EditableValue.js#L62-L63