-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
good first issueGreat for first contributions. Enable to learn the contribution process.Great for first contributions. Enable to learn the contribution process.scope: autocompleteChanges related to the autocomplete. This includes ComboBox.Changes related to the autocomplete. This includes ComboBox.type: new featureExpand the scope of the product to solve a new problem.Expand the scope of the product to solve a new problem.
Description
Is there a way to get only the option that was added/removed in the onChange event handler? Controlled auto complete shows this as their onChange handler:
onChange={(event, newValue) => {
setValue(newValue);
}}
So when i use this for multiple my previous state is [A,B] and newValue is [A,B,C]. I have to diff the previous state with next state to see what was added or removed. When I tried using event.target.value, the first onChange returns 0 then after gives me the correct value that changed.
oliviertassinari, gmltA, akharkhonov, abbasyadollahi and d-luk
Metadata
Metadata
Assignees
Labels
good first issueGreat for first contributions. Enable to learn the contribution process.Great for first contributions. Enable to learn the contribution process.scope: autocompleteChanges related to the autocomplete. This includes ComboBox.Changes related to the autocomplete. This includes ComboBox.type: new featureExpand the scope of the product to solve a new problem.Expand the scope of the product to solve a new problem.