Topic: Select setValue does not work as documented and as expected
UNNdev priority asked 3 years ago
First of all, I am really frustrated and annoyed in the meanwhile that basic functionality of the components I've just started using is buggy as hell and that the only feedback I get is "we'll look into it" with no ETA when the problems are going to be fixed. I have to spend a lot of my time finding work-arounds for bugs or quirks that should've been found during a QA process on your side especially since we don't get the components for free and a lot of MDB's functionality is built around the free Bootstrap library.
Expected behavior
The setValue
method of the Select component does what the documentation says and sets the value of the Select to the given string or array no matter which option was previously selected.
Actual behavior
setValue
does not reset the selected
attribute of the option
elements. In the code snippet linked below, click on the button that calls setValue(['7', '8'])
. Instead of having the value set to 7 and 8, you end up with 1, 4, 7, 8.
Resources (screenshots, code snippets etc.)
https://mdbootstrap.com/snippets/standard/kayem79/3167653
Michał Duszak staff answered 3 years ago
Hello, thank you for reporting this issue. We will fix this asap. By the time we fix this I recommend you using this workaround.
https://mdbootstrap.com/snippets/standard/m-duszak/3169303#js-tab-view
Jordan Mack pro commented 3 years ago
Any update on this issue? The snippet you have provided does not work for me when the select is within a modal. Even after dispose()
and reinitializing with container
attribute.
Michał Duszak staff commented 3 years ago
Could you show me the code? It will be useful for further debugging.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 3.8.1
- Device: PC
- Browser: Chrome
- OS: Windows 10
- Provided sample code: Yes
- Provided link: Yes