Skip to content

Commit cd35075

Browse files
MKirovaMKirova
authored andcommitted
chore(*): Minor fixes to sync scrollbars.
1 parent a2defd7 commit cd35075

File tree

5 files changed

+34
-12
lines changed

5 files changed

+34
-12
lines changed

projects/igniteui-angular/src/lib/directives/for-of/for_of.directive.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,10 +1436,14 @@ export class IgxGridForOfDirective<T> extends IgxForOfDirective<T> implements On
14361436
* @internal
14371437
*/
14381438
public get sizesCache(): number[] {
1439-
if (this.syncService.isMaster(this)) {
1439+
if (this.igxForScrollOrientation === 'horizontal') {
1440+
if (this.syncService.isMaster(this)) {
1441+
return this._sizesCache;
1442+
}
1443+
return this.syncService.sizesCache(this.igxForScrollOrientation);
1444+
} else {
14401445
return this._sizesCache;
14411446
}
1442-
return this.syncService.sizesCache(this.igxForScrollOrientation);
14431447
}
14441448
/**
14451449
* @hidden
@@ -1744,10 +1748,15 @@ export class IgxGridForOfDirective<T> extends IgxForOfDirective<T> implements On
17441748
* @hidden
17451749
*/
17461750
protected _calcMaxChunkSize(): number {
1747-
if (this.syncService.isMaster(this)) {
1751+
if (this.igxForScrollOrientation === 'horizontal') {
1752+
if (this.syncService.isMaster(this)) {
1753+
return super._calcMaxChunkSize();
1754+
}
1755+
return this.syncService.chunkSize(this.igxForScrollOrientation);
1756+
} else {
17481757
return super._calcMaxChunkSize();
17491758
}
1750-
return this.syncService.chunkSize(this.igxForScrollOrientation);
1759+
17511760
}
17521761
}
17531762

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,7 +2931,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
29312931
@Inject(IGX_GRID_SERVICE_BASE) public gridAPI: GridServiceType,
29322932
protected transactionFactory: IgxFlatTransactionFactory,
29332933
private elementRef: ElementRef<HTMLElement>,
2934-
private zone: NgZone,
2934+
protected zone: NgZone,
29352935
@Inject(DOCUMENT) public document: any,
29362936
public cdr: ChangeDetectorRef,
29372937
protected resolver: ComponentFactoryResolver,
@@ -6945,7 +6945,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
69456945
this.cdr.markForCheck();
69466946
}
69476947

6948-
private verticalScrollHandler(event) {
6948+
protected verticalScrollHandler(event) {
69496949
this.verticalScrollContainer.onScroll(event);
69506950
this.disableTransitions = true;
69516951

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
[igxForContainerSize]='calcHeight'
2727
[igxForItemSize]="hasColumnLayouts ? rowHeight * multiRowLayoutRowSize + 1 : renderedRowHeight"
2828
#verticalRowDimScrollContainer>
29-
<igx-pivot-row-dimension-content role='row' class="igx-grid-thead" [grid]="this" [hasMRL]="hasColumnLayouts"
29+
<igx-pivot-row-dimension-content role='row' class="igx-grid-thead" [grid]="this"
3030
[rowIndex]='rowIndex' [rowData]='rowData'
31-
[density]="displayDensity" [activeDescendant]="activeDescendant" [width]="pivotRowWidths">
31+
[density]="displayDensity" [width]="pivotRowWidths">
3232
</igx-pivot-row-dimension-content>
3333
</ng-template>
3434
</div>

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.component.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ import { IFilteringExpressionsTree } from '../../data-operations/filtering-expre
6262
import { IgxGridTransaction } from '../common/types';
6363
import { SortingDirection } from '../../data-operations/sorting-strategy';
6464
import { GridBaseAPIService } from '../api.service';
65+
import { IgxGridForOfDirective } from '../../directives/for-of/for_of.directive';
6566

6667
let NEXT_ID = 0;
6768
const MINIMUM_COLUMN_WIDTH = 200;
@@ -1030,6 +1031,18 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
10301031
return this.values.length > 1;
10311032
}
10321033

1034+
/**
1035+
* @hidden @internal
1036+
*/
1037+
@ViewChild('verticalRowDimScrollContainer', { read: IgxGridForOfDirective, static: true })
1038+
public verticalRowDimScrollContainer: IgxGridForOfDirective<any>;
1039+
1040+
protected verticalScrollHandler(event) {
1041+
this.verticalRowDimScrollContainer.onScroll(event);
1042+
super.verticalScrollHandler(event);
1043+
1044+
}
1045+
10331046
/**
10341047
* @hidden
10351048
*/

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-row-dimension-content.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div role="rowgroup" class="igx-grid-thead__wrapper" [style.width.px]="width"
2-
[attr.aria-activedescendant]="activeDescendant" [class.igx-grid__tr--mrl]="hasMRL">
2+
[class.igx-grid__tr--mrl]="hasMRL">
33
<div class="igx-grid__tr" role="row" [style.width.px]="width">
44
<ng-template ngFor #headerVirtualContainer let-column
55
[ngForOf]="rowDimension">
@@ -15,8 +15,8 @@
1515

1616
<ng-template #headerTemplate let-column>
1717
<div class='igx-grid__tr--header igx-grid__row-indentation--level-{{getLevel(column)}}'
18-
(click)="this.selectPivotRow(column, $event)">
19-
<igx-icon [attr.draggable]=" false" (click)="grid.toggleRow(getRowDimensionKey(column))">
18+
(pointerdown)="selectPivotRow(column, $event)">
19+
<igx-icon [attr.draggable]=" false" (pointerdown)="grid.toggleRow(getRowDimensionKey(column))">
2020
{{ getExpandState(column) ? 'expand_more' : 'chevron_right'}}</igx-icon>
2121
{{column.header}}
2222
</div>
@@ -25,7 +25,7 @@
2525
<ng-template #headerDefaultTemplate let-column>
2626

2727
<div class='igx-grid__tr--header igx-grid__row-indentation--level-{{getLevel(column)}}'
28-
(click)="this.selectPivotRow(column, $event)">
28+
(pointerdown)="selectPivotRow(column, $event)">
2929
<igx-icon style='flex-shrink: 0;' [attr.draggable]=" false">
3030
</igx-icon>
3131
{{column.header}}

0 commit comments

Comments
 (0)