Select dropdown shows incorrect value if blank


Topic: Select dropdown shows incorrect value if blank

yorkmyers pro premium priority asked 2 years 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.


mlazaru staff answered 2 years ago

Hi,

It seems adding selected attribute causes this issue. Try to use Select.setValue() instead.

https://mdbootstrap.com/snippets/standard/mlazaru/4644788


yorkmyers pro premium priority commented 2 years ago

Great, thank you!!


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue
  • User: Pro
  • 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
Tags