react-dat-gui icon indicating copy to clipboard operation
react-dat-gui copied to clipboard

Bug: min and max can be gotten around in DatNumber

Open josh-peterson-bose opened this issue 5 years ago • 1 comments

Steps to repro:

  1. Focus a DatNumber field.
  2. Move the cursor to the beginning of the number entered. Eg if the number is 66 as in the demo, move the cursor before the first 6.
  3. Type "1". Notice the value of the "Number" at left now says 166, ignoring the max of 100.
  4. You can also try this by inserting a minus sign. The number will say "-66" ignoring the min of 0.

josh-peterson-bose avatar Jan 08 '20 23:01 josh-peterson-bose

@rohan-deshpande Can we get <DatNumber/> to have the same behavior for <Input/> and the <Slider/>? Looks like we can just reuse handleSliderUpdate

PR #49

From this

handleChange = event => {
    const { value } = event.target;
    this.update(value);
};

To this

handleChange = event => {
    const { value } = event.target;
    this.handleSliderUpdate(value);
};

jdbence avatar Feb 29 '20 09:02 jdbence