Topic: Material Select (MDB Pro) not retaining selection
gregs_legs pro asked 5 years ago
I've just updated MDB-Pro from 4.8.7 to 4.8.10 and it seems to have broken my Material Select elements in Woocommerce forms:-
Expected behavior Select an option and the drop-down retains the selected option.
Actual behavior Select an option and the drop-down returns to 'Choose an Option'.
Resources (screenshots, code snippets etc.)
jQuery(document).ready(function($){ $('.mdb-select').materialSelect(); });
The selector is currently wrapped in the class 'mdb-select'. If I change the class to 'browser-default custom-select' I no longer get my styling but at least the selector works. Similarly, reverting to 4.8.7 fixes the issue.
What am I missing ?
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.8.10
- Device: PC
- Browser: Any
- OS: Windows 10
- Provided sample code: No
- Provided link: No
gregs_legs pro commented 5 years ago
Have tested as a snippet - 4.8.9 works ok but 4.8.10 doe not work.
y2k_eclipse free commented 5 years ago
I am having a similar issue. I do have 5 dropdowns (materialSelect) that are populated on the fly.
It appears to be an issue populating the dropdowns on runtime. I use code like this to do so (which works fine with the "browser-default custom-select"):
function updateCities(cities) { try { $('#selectCity').empty();
}
MDBootstrap staff commented 5 years ago
Hi, I understand the issue. I will forward this information to the design team to fix the class interaction. Thank you all for your feedback!
gregs_legs pro commented 5 years ago
Any progress on this ?
Sebastian Kaczmarek staff commented 5 years ago
Have you tried upgrading to 4.8.11? We have fixed a lot of issues with MS