Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: But in material_select()

Joey Novak free asked 6 years ago


In html, spaces are ignored.  In the material_select code, you use the label values to determine the correct li to display from the value of the select.  Unfortunatly this means that if you have any extra whitespace around the label in an option it won't be pre-selected when the select is turned into a material_select.

i.e. the below will cause the material_select to be blank instead of have 10 visible.  The fix to this is where you have "

<select>
  <option value="10" selected> 10</option>
</select>

The fix to this, is where you have "var sanitizedLabelHtml = label.replace(/"/g, '&quot;')" add .trim() onto the end.  It would be much better if instead of using labels you added a data item to each LI that indicated it's value and on click of an li you used that data item to determine what value to set the select to.


Mikołaj Smoleński staff answered 6 years ago


Thanks for advice. We'll discuss this suggestion and try to update it with the next release. Regards

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

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags