Topic: Page tabs 150ms delay causing problems

ChrisPaulson free asked 6 years ago


The method that sets the tab set active uses a 150ms async method before active is set (see below). This is part of the tab.directive.ts file. It means that when the select event fires on the tab, it is not physically active until this timeout has completed so we need to set a loop to wait until active is true :(. Could this code be improved somehow? Made to be an observable or something like that? MDB angular code: -
public set active(active: boolean) {
    if (this.disabled && active || !active) {
      if (!active) {
       this.removeClass(this.el.nativeElement, 'show');
        setTimeout(() => {
          this._active = active;
          this.deselect.emit(this);
        }, 150);
      }
      return;
    }
    setTimeout(() => {
      this._active = active;
      this.classAdd(this.el.nativeElement, 'show');
    }, 150);

    this.select.emit(this);
    this.tabset.tabs.forEach((mdbTab: TabDirective) => {
      if (mdbTab !== this) {
        mdbTab.active = false;
      }
    });
  }
 

                
                  

Damian Gemza staff commented 6 years ago

Dear ChrisPaulson, If you need fix for this situation right now, you have to rewrite it on your hand. We'll take a deeper look at this situation, and we'll think how to improve this is future releases, but I can't provide you any ETA on this. Best Regards, Damian


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Opened

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: Yes
  • Provided link: No
Tags