[material-ui][Autocomplete] onInputChange called with undefined event contrary to type definition
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Steps to reproduce
Link to live example: (required) https://stackblitz.com/edit/react-ouzbqw?file=Demo.tsx
Steps:
- Set the onInputChange prop
- Check what is passed in for the event param
Current behavior
Hello 👋
I'm noticing that the onInputChange is typed as:
onInputChange?: (
event: React.SyntheticEvent,
value: string,
reason: AutocompleteInputChangeReason,
) => void;
with a non-null event param, but null seems to be coming through for the param on mount. See demo:
Expected behavior
I'm not sure if onInputChange is supposed to be called on mount or not, but if it is and it's expected that null is an option for event, would it be possible to update the typing of onInputChange to reflect that?
Thanks!
Context
We are trying to use strict null safety
Your environment
See https://stackblitz.com/edit/react-ouzbqw?file=Demo.tsx - also reproduce-able in this docs demo
Search keywords: onInputChange undefined event
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.