Topic: Select max options limit
parson premium asked 1 year ago
I am trying to set a limit for the maximum number of options that can be selected. There isn't a native way of setting this so I added an event listener for 'valueChange.mdb.select'.
If the number of selected options is >= 5 then it iterates through the list of options setting them to disabled. This works perfectly well apart from the dropdown refuses to close.
It throws an error
Uncaught TypeError: can't access property "selected", this._selectAllOption is null
I've created a snippet Select Max Option Errors
This is because we have a problem with using the
select component with
Select all and
Filter together. It will throw this error even without your customization.
We are aware of this bug and will fix it soon.
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Premium
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 4.2.0
- Device: PC
- Browser: Firefox/Chrome
- OS: Windows 10
- Provided sample code: No
- Provided link: Yes