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