Skip to content

Commit

Permalink
Merge pull request #10315 from IgniteUI/dTsvetkov/fix-10075-master
Browse files Browse the repository at this point in the history
fix(toolbar): get correct width inside tabs
  • Loading branch information
hanastasov authored Oct 26, 2021
2 parents e82234c + 832bbc3 commit 29955a5
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import {
Inject,
Input,
OnDestroy,
OnInit,
Optional
} from '@angular/core';
import { first } from 'rxjs/operators';
import { Subscription } from 'rxjs';
import { IDisplayDensityOptions, DisplayDensityToken, DisplayDensityBase } from '../../core/displayDensity';
import { IgxIconService } from '../../icon/public_api';
Expand All @@ -30,7 +28,7 @@ import { GridType } from '../common/grid.interface';
selector: 'igx-grid-toolbar',
templateUrl: './grid-toolbar.component.html'
})
export class IgxGridToolbarComponent extends DisplayDensityBase implements OnInit, OnDestroy {
export class IgxGridToolbarComponent extends DisplayDensityBase implements OnDestroy {

/**
* When enabled, shows the indeterminate progress bar.
Expand Down Expand Up @@ -106,10 +104,6 @@ export class IgxGridToolbarComponent extends DisplayDensityBase implements OnIni
return this.displayDensity === 'compact';
}

/** @hidden @internal */
@HostBinding('style.max-width.px')
@HostBinding('style.flex-basis.px')
public width = null;

protected _grid: IgxGridBaseDirective;
protected sub: Subscription;
Expand All @@ -125,12 +119,6 @@ export class IgxGridToolbarComponent extends DisplayDensityBase implements OnIni
this.iconService.addSvgIconFromText(unpinLeft.name, unpinLeft.value, 'imx-icons');
}

/** @hidden @internal */
public ngOnInit() {
this.grid.rendered$.pipe(first()).subscribe(() => this.width = this.grid.outerWidth);
this.sub = this.grid.resizeNotify.subscribe(() => this.width = this.grid.outerWidth);
}

/** @hidden @internal */
public ngOnDestroy() {
this.sub?.unsubscribe();
Expand Down

0 comments on commit 29955a5

Please sign in to comment.