Topic: Select dropdown shows incorrect value if blank
yorkmyers priority asked 1 year ago
In my select dropdown, I'm using a placeholder as a "hack" to get the value of this element.
If a select dropdown has a value upon page load... and you change the value in it to be "blank"... then the placeholder value appears "over" the previous value:
https://mdbootstrap.com/snippets/standard/yorkmyers/4641178
The component is aware that the value should be blank, but that's not what is shown on the screen.
Mateusz Lazaru staff answered 1 year ago
Hi,
It seems adding selected
attribute causes this issue. Try to use Select.setValue()
instead.
https://mdbootstrap.com/snippets/standard/mlazaru/4644788
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.11.0
- Device: Desktop
- Browser: Chrome
- OS: Windows
- Provided sample code: No
- Provided link: Yes