Topic: How to have multiple select set value to null or empty array?

Jordan Mack pro asked 1 year ago

Expected behavior Setting multiple select to: null or [] to unselect all values

Actual behavior first options is always selected

Resources (screenshots, code snippets etc.)

I've created a snippet here:

Kamila Pieńkowska staff answered 1 year ago

The set value method works well. Problem is with you setting multiple via JS option. Pass it as attribute and it will work well. Your snippet adjusted:

Example from the documentation:

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: Pro
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 6.0.0
  • Device: Intel x86
  • Browser: Chrome
  • OS: Ubuntu 22.04
  • Provided sample code: Yes
  • Provided link: Yes