简体   繁体   中英

Mui Select with native=true doesn't fire onOpen event

I'm trying to use onOpen with MUI's Select component but it won't fire with native=true. I need to have this event fire with native select and in the documentation it isn't mentioned that native disables onOpen function. Anyone know why or how to get it to work?

I've tried to find some answers online but none that really gave any answers.

heres a codesandbox where you'll see I tried to console onOpen: https://codesandbox.io/s/withered-night-fyz3eg?file=/demo.js

It works only if native = false https://github.com/mui/material-ui/blob/b5d1b54562372268b6ec7e1b70fb2192442c08ba/packages/mui-material/src/Select/Select.js#L98


* Callback fired when the component requests to be opened.
* Use it in either controlled (see the open prop), or uncontrolled mode (to detect when the Select expands). *
* @param {object} event The event source of the callback.
* onOpen : PropTypes.func

* If true , the component is shown.
* You can only use it when the native prop is false (default).
* open : PropTypes.bool,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM