Skip to content

Commit df5ac7b

Browse files
MKirovaMKirova
authored andcommitted
Merge branch 'mkirova/fix-10934' of https://github.com/IgniteUI/igniteui-angular.git
2 parents 8352665 + a3d1c13 commit df5ac7b

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

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

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,14 +1413,19 @@ export class IgxForOfDirective<T> implements OnInit, OnChanges, DoCheck, OnDestr
14131413
}
14141414

14151415

1416-
private _adjustScrollPositionAfterSizeChange(sizeDiff) {
1416+
protected _adjustScrollPositionAfterSizeChange(sizeDiff) {
14171417
// if data has been changed while container is scrolled
14181418
// should update scroll top/left according to change so that same startIndex is in view
14191419
if (Math.abs(sizeDiff) > 0 && this.scrollPosition > 0) {
14201420
this.recalcUpdateSizes();
1421-
const offset = parseInt(this.dc.instance._viewContainer.element.nativeElement.style.top, 10);
1421+
const offset = this.igxForScrollOrientation === 'horizontal' ?
1422+
parseInt(this.dc.instance._viewContainer.element.nativeElement.style.left, 10) :
1423+
parseInt(this.dc.instance._viewContainer.element.nativeElement.style.top, 10);
14221424
const newSize = this.sizesCache[this.state.startIndex] - offset;
1423-
this.scrollPosition = newSize === this.scrollPosition ? newSize + 1 : newSize;
1425+
this.scrollPosition = newSize;
1426+
if (this.scrollPosition !== newSize) {
1427+
this.scrollComponent.scrollAmount = newSize;
1428+
}
14241429
}
14251430
}
14261431

@@ -1575,8 +1580,11 @@ export class IgxGridForOfDirective<T> extends IgxForOfDirective<T> implements On
15751580
}
15761581
this.syncService.setMaster(this);
15771582
this.igxForContainerSize = args.containerSize;
1578-
this._updateSizeCache(changes);
1583+
const sizeDiff = this._updateSizeCache(changes);
15791584
this._applyChanges();
1585+
if (sizeDiff) {
1586+
this._adjustScrollPositionAfterSizeChange(sizeDiff);
1587+
}
15801588
this._updateScrollOffset();
15811589
this.dataChanged.emit();
15821590
}
@@ -1652,8 +1660,10 @@ export class IgxGridForOfDirective<T> extends IgxForOfDirective<T> implements On
16521660

16531661
protected _updateSizeCache(changes: IterableChanges<T> = null) {
16541662
if (this.igxForScrollOrientation === 'horizontal') {
1655-
this.initSizesCache(this.igxForOf);
1656-
return;
1663+
const oldSize = this.sizesCache[this.sizesCache.length - 1];
1664+
const newSize = this.initSizesCache(this.igxForOf);
1665+
const diff = oldSize - newSize;
1666+
return diff;
16571667
}
16581668

16591669
const oldHeight = this.heightCache.length > 0 ? this.heightCache.reduce((acc, val) => acc + val) : 0;
@@ -1681,6 +1691,7 @@ export class IgxGridForOfDirective<T> extends IgxForOfDirective<T> implements On
16811691
}
16821692
});
16831693
}
1694+
return diff;
16841695
}
16851696

16861697
protected handleCacheChanges(changes: IterableChanges<T>) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</ng-template>
6363
</ng-template>
6464
<ng-template #record_template let-rowIndex="index" let-rowData>
65-
<igx-pivot-row [pivotRowWidths]='pivotRowWidths' [gridID]="id" [index]="rowIndex" [data]="rowData"
65+
<igx-pivot-row [style.min-height.px]="renderedRowHeight" [pivotRowWidths]='pivotRowWidths' [gridID]="id" [index]="rowIndex" [data]="rowData"
6666
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:false:pipeTrigger"
6767
[ngStyle]="rowStyles | igxGridRowStyles:rowData:rowIndex:pipeTrigger" #row>
6868
</igx-pivot-row>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<!-- Column headers area -->
120120
<div class="igx-grid__tr" role="row" [style.width.px]="width">
121121
<div #pivotContainer class="igx-grid__tr-pivot igx-grid__tr-pivot--row-area"
122-
[style.min-width.px]="grid.pivotRowWidths - 1" (igxDragLeave)="onAreaDragLeave($event, rowArea)" igxDrop
122+
[style.width.px]="grid.pivotRowWidths - 1" (igxDragLeave)="onAreaDragLeave($event, rowArea)" igxDrop
123123
(dropped)="onDimDrop($event, rowArea, 0)" (pointerdown)="$event.preventDefault()">
124124
<!-- Row area -->
125125
<igx-chips-area #rowArea droppable='true'>

0 commit comments

Comments
 (0)