Topic: Issues with color attribute of mdbBtn not updating with bindings

jarenteria pro asked 4 years ago


Hello,

I'm trying to bind the color attribute of MdbBtn directive like this:

html:

    <div class="dropdown" mdbDropdown>
      <button type="button"
          mdbDropdownToggle mdbBtn
          [color]="statusColor"
          class="dropdown-toggle waves-light"
          style="width:170px;"
          mdbWavesEffect>
    {{ status }}
  </button>

  <div class="dropdown-menu dropdown-primary">
    <ng-container *ngFor="let value of statuses">
      <div class="divider dropdown-divider" *ngIf="value === 'canceled'"></div>
      <button class="dropdown-item"  (click)="changeStatus(value)">{{ value }}</button>
    </ng-container>
  </div>
</div>

When statusColor changes in the component.ts the color property seems not to be updated. For example if we do this:

changeStatus(newStatus) { 
        this.status = newStatus;
        statusColor = (newStatus === 'canceled') ? 'danger' : 'primary'
 }

Expected Behavior is color should toggle colors when the statusColor bind property changes.

Can someone look at this ?

Thank you so much,Jose Renteria


Arkadiusz Idzikowski staff commented 4 years ago

Thank you for letting us know about this problem, we will take a closer look at that.


jarenteria pro commented 4 years ago

Hi Arkadiusz, I just learn how to add code to the post, I added some code. Thanks for looking at this.


jarenteria pro answered 4 years ago


Thank you Bartosz,

I see this bug has been fixed with Version 8.6.0 !!

I really like mdb!

Regards, Jose Renteria


jarenteria pro answered 4 years ago


Thank you Bartosz, do you have a date for the next version of MDB ?


Bartosz Termena staff commented 4 years ago

Hi!

The new version will come out within 2 weeks

Best Regards, Bartosz.


jarenteria pro answered 4 years ago


Any updates on this ?, I really need this to work...


Bartosz Termena staff commented 4 years ago

Dear @jarenteria

I assure you that the problem will be resolved in the next version of MDB

Best Regards, Bartosz.



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 8.4.0
  • Device: All
  • Browser: Chrome
  • OS: All
  • Provided sample code: No
  • Provided link: No