Topic: Bootstrap 5 Select component not allowing an option with no value to be selected

richard.hetherington priority asked 1 year ago

*Expected behavior*Mark an option as selected on load - set in previous page loadBe able to select an option with no value so that the field can be reset / cleared if no options are valid (optional field)

*Actual behavior*Once an option is marked as selected using attribute, you can no longer select an option with no value. It remains on the same selected value as per page load.

Resources (screenshots, code snippets etc.)

Mateusz Lazaru staff answered 1 year ago


check out code in the snippet:

const instance = mdb.Select.getInstance(selectEl).setValue('3')

richard.hetherington priority commented 1 year ago

Hi mlazaru, that would require modifying code across many, many websites to put a work around in for something that is standard html.

Why are options with no value not selectable?

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 4.2.0
  • Device: Desktop PC
  • Browser: Firefox Developer Edition (latest)
  • OS: Windows 10 Pro
  • Provided sample code: No
  • Provided link: Yes