Topic: Issue with Material Select fields disappearing (after upgrade to 4.17)
Hi there
i have a set of 2 material select fields.
What should happen:
Field 1: you choose monthly or yearly.
- if you choose monthly, you should get another material select that appears where you choose 1 to 31.
- If you choose yearly - you get a field with a date-picker where you can choose the date.
In all cases, Field 1 should remain visible, so that the user can change his selection from daily to yearly and vice versa.
Both step 2 fields are hidden via CSS initially, and then based on the value of Field 1 - i show/hide and initiate the MaterialSelect() on the field.
This was working perfectly till about version 4.8 - i recently upgraded to 4.17 and this is stopped working.
I am attaching my snippet here: https://mdbootstrap.com/snippets/jquery/moshe/2117948
what actually happens - that once you make your initial selection in Field 1, nothing appears for step 2 (not the monthly drop down, nor the date picker field) , and even more strangely - Field 1 itself disappears.
Can anyone figure this out?
Tomek Makowski staff answered 5 years ago
Hi
Try this solution.
https://mdbootstrap.com/snippets/jquery/tomekmakowski/2145292?view=project#js-tab-view
Regards
Kneidels pro commented 5 years ago
Hi.Thanks. for some reason, i didnt see this answer.
Am trying it out - but it seems you forgot the datepicker field that is supposed to come if you select "yearly".
i have tried with this https://mdbootstrap.com/snippets/jquery/moshe/2186007 but it does not work (the datepicker does not open)
(also trying to combine with this answer provided so that user can click anywhere https://mdbootstrap.com/snippets/jquery/grzegorz-bujanski/2130795 )
Thanks
Kneidels pro commented 4 years ago
bump ^^ Thanks Tomek
Tomek Makowski staff commented 4 years ago
You just have to initialize input:date
as datepicker.
Check this out:
https://mdbootstrap.com/snippets/jquery/tomekmakowski/2145292?view=project#html-tab-view
Kneidels pro commented 4 years ago
Perfect thank you!
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.17.0
- Device: PC
- Browser: Firefox/Chrome
- OS: Win10
- Provided sample code: No
- Provided link: Yes
Kneidels pro commented 5 years ago
BTW - this DOES work - when i do NOT use materialSelect() and use show/hide functions instead. https://mdbootstrap.com/snippets/jquery/moshe/2118094
Grzegorz Bujański staff commented 5 years ago
This looks like a problem with the material select removal function. I will add it to our to-do list. We'll fix it.
Kneidels pro commented 5 years ago
Thanks - hopefully it can be done soon :-) OR at least a work-around ... seen as this is being used in live apps.
Thanks!!