Wait for the value to have changed in the input (#4844)
This commit is contained in:
parent
8edee76f8b
commit
d98b7aab61
@ -214,6 +214,7 @@ export default class Input extends Component {
|
|||||||
|
|
||||||
onChange = (event, value) => {
|
onChange = (event, value) => {
|
||||||
event.persist();
|
event.persist();
|
||||||
|
|
||||||
this.setValue(value, () => {
|
this.setValue(value, () => {
|
||||||
this.props.onChange && this.props.onChange(event, value);
|
this.props.onChange && this.props.onChange(event, value);
|
||||||
});
|
});
|
||||||
@ -231,12 +232,10 @@ export default class Input extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onPaste = (event) => {
|
onPaste = (event) => {
|
||||||
const { value } = event.target;
|
// Wait for the onChange handler to be called
|
||||||
const pasted = event.clipboardData.getData('Text');
|
|
||||||
|
|
||||||
window.setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
this.onSubmit(value + pasted);
|
this.onSubmit(this.state.value);
|
||||||
}, 0);
|
}, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
onKeyDown = (event) => {
|
onKeyDown = (event) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user