react-hook-form-mui
react-hook-form-mui copied to clipboard
control displayEmpty for SelectElement
Duplicates
- [X] I have searched the existing issues
Latest version
- [X] I have tested the latest version
Summary 💡
Hey!
I am implementing custom styled forms, therefore I am not using label as placeholder. It's causing an issue when trying to set a placeholder for SelectElement, as there is no other way.
Would be super nice to be able to control displayEmpty property of SelectInput subcomponent. According to my tests it allows to display first item from options, if it's value set is undefined (id being not set)
Alternatively you could add a simple property disabled for item in options. That way it's less hacky :)
Thanks!
Examples 🌈
https://codesandbox.io/s/exciting-hofstadter-rnmpsc?file=/demo.tsx
Any PR is welcome