Topic: After upgrade to PRO 4.8.2 material select selected value not displaying

studioinsight free asked 5 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.



Hi there,

Is this fixed in 4.8.4 ?

Thank you !


MDBootstrap staff commented 5 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.


.jodadev. pro commented 5 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 commented 5 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!


Clemence free answered 5 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());
    }

Bartłomiej Malanowski staff commented 5 years ago

This bug is still on our TODO list



It's a bug that will be fixed soon. For now, please add the .md-selected class to your select element


Thomas Emmanuel free answered 5 years ago


I have the same issue.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: 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