Open
Description
Steps to reproduce
Steps:
- Add an
Autocomplete
component withmultiple={true}
anddisableClearable={false}
. - Add values
- Press the clear button
Current behavior
When onChange
is called you get:
• event = {...}
• value = []
• reason = 'clear'
• details = undefined
Expected behavior
When onChange
is called you get:
• event = {...}
• value = []
• reason = 'clear'
• details = { option: [...clearedValues] }
Context
When you have an Autocomplete
with multiple
and not disableClearable
and you:
- Select an option (op5) you get:
•event = {...}
•value = [op1, op2, op5]
•reason = 'selectOption'
•details = { option: op5 }
- Remove an option (op5) you get:
•event = {...}
•value = [op1, op2]
•reason = 'removeOption'
•details = { option: op5 }
Your environment
npx @mui/envinfo
System:
OS: Windows 10 10.0.19045
Binaries:
Node: 18.20.3 - C:\Program Files\nodejs\node.EXE
npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
pnpm: 8.14.0 - C:\Program Files\nodejs\pnpm.CMD
Browsers:
Chrome: Not Found
Edge: Chromium (131.0.2903.51)
npmPackages:
@emotion/react: ^11.13.3 => 11.13.3
@emotion/styled: ^11.13.0 => 11.13.0
@mui/base: 5.0.0-beta.40
@mui/core-downloads-tracker: 6.1.7
@mui/icons-material: ^6.1.7 => 6.1.7
@mui/lab: 5.0.0-alpha.173
@mui/material: ^6.1.7 => 6.1.7
@mui/private-theming: 5.16.6
@mui/styled-engine: 5.16.6
@mui/system: 5.16.7
@mui/types: 7.2.19
@mui/utils: 5.16.6
@types/react: 18.3.12
react: ^18.3.1 => 18.3.1
react-dom: ^18.3.1 => 18.3.1
typescript: 4.9.5
I use Chrome: Version 131.0.6778.86 (Official Build) (64-bit)
Search keywords: multiple onChange reason clear details disableClearable