Topic: After upgrade to PRO 4.8.2 material select selected value not displaying
studioinsight asked 6 years ago
<select class="mdb-select md-form md-outline colorful-select dropdown-primary mb-0"
id="offer_type">
<?php foreach (Offer::OFFER_TYPES as $key => $value): ?>
<option value="<?php echo $value ?>"
<?php echo $this->data->offer->offer_type == $value ? "selected" : "" ?>
><?php echo Language::_($key); ?></option>
<?php endforeach; ?>
</select>
This is my select, and I would like to point out that it was perfectly working before the update. When I open the dropdown, the correct selected option displays, but the label of the material select always points to the first option.
HeyCaptain pro answered 6 years ago
Hi there,
Is this fixed in 4.8.4 ?
Thank you !
MDBootstrap staff pro premium priority commented 6 years ago
Hi Captain,
Problem with our material select is more complicated than we thought. We need more time to rewrite it so please be patient.
.jonathan. pro commented 6 years ago
Why don't you guys either remove it form the documentation or state that there's a bug and therefor it doesn't work and is temporarily unavailable? Here's the link: https://mdbootstrap.com/docs/jquery/forms/select/
By not mentioning there's a bug, you make us waste hours trying to fix something unfixable. Just a feedback.
Thanks for y'all hardwork!
MDBootstrap staff pro premium priority commented 6 years ago
Hi .jonathan., We are currently working on fixing this component. We couldn't simply remove it from the package because we need to be backwards compatible and the component doesn't break any functionality it should serve and it will be fixed soon. Thanks for the feedback!
Thomas Emmanuel answered 6 years ago
Bartłomiej Malanowski staff pro premium answered 6 years ago
It's a bug that will be fixed soon. For now, please add the .md-selected
class to your select element
Clemence answered 6 years ago
Hello, any updates for this issue ?I changed this line and it works for me
if (this.$materialSelectedOption.length > 0) {
this.mainLabel.addClass('active');
this.$materialSelect.val(this.$materialSelectedOption.text());
}
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.8.0
- Device: Mobile first
- Browser: Chrome
- OS: W10
- Provided sample code: No
- Provided link: No