Disabled MDBSelect


Topic: Disabled MDBSelect

DevPaulLeon asked a year ago

Hello!

Is there some way to set enabled=false to MDBSelect?

I need this because of validation!

Thanks!


Piotr Glejzer staff answered a year ago

Hi,

Yes, It is possible. You can check our API about MDBSelect. https://mdbootstrap.com/docs/react/forms/select/

Top page, a blue bar with API link. https://ibb.co/1f3XR5h

There are options with arrays and you can set a disabled property to this object in the array.

Best,Piotr


DevPaulLeon commented a year ago

So, the only way to do this is to set every option to disabled?


Piotr Glejzer staff commented a year ago

I think so, there is API documentation where you can see what can you use. What do you exactly need?


DevPaulLeon commented a year ago

I want to disabled MDBSelect!

For example, if an input is disabled it doesn't even catch focus. So, that's the behavior that I want for my MDBSelect! With the solution that you are proposing me, the MDBSelect is going to show its options, of course I won't be able to click any of them beacuse all of them are disabled. But, the expected behavior is that the MDBSelect (which contain options) mustn't show any option, it must have the input css style.

I hope this pen can help

https://codepen.io/DevPaulLeon/pen/abbVyLP


Piotr Glejzer staff commented a year ago

Ok, I understand now. Sorry about that misunderstanding. Hmm, I think this is no possible to do it now. Sorry about that. We will do refactoring this component in the nearly future. I will do a fast workaround about that for you in my free time. Best,Piotr


Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: React
  • MDB Version: 4.22.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No
Tags