MCPcopy Create free account
hub / github.com/angular/components / _setTabBodyWrapperHeight

Method _setTabBodyWrapperHeight

src/material/tabs/tab-group.ts:526–541  ·  view source on GitHub ↗

* Sets the height of the body wrapper to the height of the activating tab if dynamic * height property is true.

(tabHeight: number)

Source from the content-addressed store, hash-verified

524 * height property is true.
525 */
526 _setTabBodyWrapperHeight(tabHeight: number): void {
527 if (!this.dynamicHeight || !this._tabBodyWrapperHeight) {
528 this._tabBodyWrapperHeight = tabHeight;
529 return;
530 }
531
532 const wrapper: HTMLElement = this._tabBodyWrapper.nativeElement;
533
534 wrapper.style.height = this._tabBodyWrapperHeight + 'px';
535
536 // This conditional forces the browser to paint the height so that
537 // the animation to the new height can have an origin.
538 if (this._tabBodyWrapper.nativeElement.offsetHeight) {
539 wrapper.style.height = tabHeight + 'px';
540 }
541 }
542
543 /** Removes the height of the tab body wrapper. */
544 _removeTabBodyWrapperHeight(): void {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected