Topic: But in material_select()
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, '"')" 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.
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No