-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
scope: autocompleteChanges related to the autocomplete. This includes ComboBox.Changes related to the autocomplete. This includes ComboBox.type: bugIt doesn't behave as expected.It doesn't behave as expected.
Description
- [ x ] The issue is present in the latest release.
- [ x ] I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
Clearing the TextField by use of AutoComplete's clear indicator does not trigger any callbacks (onInputChange, onChange, onOpen, onClose). It also does not trigger the TextField's onChange callback either.
Expected Behavior 🤔
Trigger onChange, onInputChange or a new callback if required.
Steps to Reproduce 🕹
const onChangeEvent = (event) => {
console.log(event);
};
const onInputChangeEvent = (event, value) => {
console.log(event);
};
<Autocomplete
options={["A", "B", "C", "D"]}
onChange={ onChangeEvent }
onInputChange={ onInputChangeEvent }
renderInput={ (params) => (
<TextField { ...params } label="Field" variant="outlined" fullWidth />
)
}
freeSolo
/>
Steps:
- Select option in TextInput or type in text
- Press the clear button
- Check console for expected event
Context 🔦
Tracking the state of the TextField will require querying of the TextField on submission.
Your Environment 🌎
| Tech | Version |
|---|---|
| Material-UI | 4.8.0 |
| React | 16.8.6 |
| Browser | Chrome 79 |
| TypeScript | 3.7.3 |
lumberg72 and nbunney
Metadata
Metadata
Assignees
Labels
scope: autocompleteChanges related to the autocomplete. This includes ComboBox.Changes related to the autocomplete. This includes ComboBox.type: bugIt doesn't behave as expected.It doesn't behave as expected.