Not debouncing when input has a value?
Use case
<Debounce time="400" handler="onChange">
<TextField type='number' id='tempMin' value={this.props.temp.min} hintText='Min threshold' onChange={this.setTempMin.bind(this)} />
<Debounce />
If I remove value={this.props.temp.min}, it works perfectly.
I also have an issue when setting the value to a prop. Debouncing works fine, but when the "props" value gets resetted to an empty string with a following re-render, the value in the box will still show the old one. When removing the <Debounce /> component I don't have the same issue.
I'm having the same issue. When setting the input's value property, subsequent onChange events have the value set to the initial value of the input and not to the one I just set by typing something:
<Debounce time="400" handler="onChange">
<input type="text"
value={query}
onChange={(e) => console.log(e.currentTarget.value)}
/>
</Debounce>
This works though:
<Debounce time="400" handler="onChange">
<input type="text"
// value={query}
onChange={(e) => console.log(e.currentTarget.value)}
/>
</Debounce>
same problem. I need to set an initial value to the field before modifying it. defaultValue kinda works but doesn't go well with input modifications by state.
The same thing: doesn't work if the <input> contains "value" attribute.