Skip to content

[TabNav] Make _activeLinkChanged and _activeLinkElement public in MatTabNav component #10939

@AncelHernandez

Description

@AncelHernandez

Bug, feature request, or proposal:

Please make _activeLinkChanged and _activeLinkElement in MatTabNav public again, or at least protected.

The change came from: #9701

I had a tab component that extends MatTabNav and I cant access _activeLinkElement.

here's the component:

@Component({
  selector: '[vertical-tab-nav-bar]',
  templateUrl: './vertical-tab-nav-bar.component.html',
  styleUrls: ['./vertical-tab-nav-bar.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
  encapsulation: ViewEncapsulation.None,
  host: {'class': 'vertical-tab-nav-bar'},
})
export class VerticalTabNavBarComponent extends MatTabNav {

  @ViewChild(VerticalInkBar) _verticalInkBar: VerticalInkBar;

  constructor(
    elementRef: ElementRef,
    @Optional() dir: Directionality,
    ngZone: NgZone,
    changeDetectorRef: ChangeDetectorRef,
    viewportRuler: ViewportRuler,
  ) {
    super(elementRef, dir, ngZone, changeDetectorRef, viewportRuler);
  }


  // /** Aligns the ink bar to the active link. */
  _alignInkBar(): void {
    if (this._activeLinkElement) {
      this._verticalInkBar.show();
      this._verticalInkBar.alignToElement(this._activeLinkElement.nativeElement);
    } else {
      this._verticalInkBar.hide();
    }
  }
}

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions