react-hook-form-mui icon indicating copy to clipboard operation
react-hook-form-mui copied to clipboard

control displayEmpty for SelectElement

Open ogflow opened this issue 2 years ago • 1 comments

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

ogflow avatar Jul 07 '23 11:07 ogflow

Any PR is welcome

dohomi avatar Jul 10 '23 02:07 dohomi