Topic: When using a main label, material-select does not display the selected option when set programmatically via .val('value')

Legay free asked 5 years ago

Expected behavior

When setting $nativeSelect.val('selected value') on a single-choice material select instance, it should display the label that matches the selected value, regardless of whether a main label is being used.

Actual behavior

After setting the value, it is shown as active in the list, but does not appear next to the caret.

Resources (screenshots, code snippets etc.)

This is has to do with the constructor defining this.$materialSelectInitialOption, but then ignoring it if a main label has been defined. This is incorrect - when an item is selected, its label should always show up.

Piotr Glejzer staff commented 5 years ago

Thanks for a report, I added to this our list we look into this as soon as possible.

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: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.7.7
  • Device: laptop
  • Browser: Chrome
  • OS: Win 10
  • Provided sample code: No
  • Provided link: No