Skip to content

Commit a5e1d9e

Browse files
authored
Merge branch '20.1.x' into rivanova/fix-16273-20.1.x
2 parents 54ad18a + 0294fb3 commit a5e1d9e

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

projects/igniteui-angular/src/lib/splitter/splitter.component.spec.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -490,27 +490,22 @@ describe('IgxSplitter resizing with minSize and browser window is shrinked', ()
490490
const minSize = parseInt(pane1.minSize);
491491
spyOn(splitter, 'onMoveEnd').and.callThrough();
492492

493-
pane1.size = (splitter.getTotalSize() - parseInt(pane2.size)) + 'px';
494-
fixture.detectChanges();
495-
496493
splitterBarComponent.moveStart.emit(pane1);
497494
fixture.detectChanges();
498495
splitterBarComponent.movingEnd.emit(splitter.getTotalSize() -minSize);
499496
fixture.detectChanges();
500497

501498
splitter.elementRef.nativeElement.style.width = '500px';
502-
pane2.size = (splitter.getTotalSize() - minSize) + 'px';
503499
fixture.detectChanges();
504500

505501
splitterBarComponent.moveStart.emit(pane1);
506502
fixture.detectChanges();
507-
splitterBarComponent.movingEnd.emit(-400);
503+
splitterBarComponent.movingEnd.emit(-200);
508504
fixture.detectChanges();
509505

510-
const isFullSize = pane1.size === '100%' || pane1.size === (splitter.getTotalSize() + 'px');
511-
512506
expect(splitter.onMoveEnd).toHaveBeenCalled();
513-
expect(isFullSize).toBeTruthy();
507+
expect(pane1.size).toEqual('80%');
508+
expect(pane2.size).toEqual('100px');
514509
});
515510
});
516511

projects/igniteui-angular/src/lib/splitter/splitter.component.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,9 @@ export class IgxSplitterComponent implements AfterContentInit {
244244
let [ paneSize, siblingSize ] = this.calcNewSizes(delta);
245245

246246
if (paneSize + siblingSize > this.getTotalSize() && delta < 0) {
247-
paneSize = this.getTotalSize();
248-
siblingSize = 0;
249-
} else if(paneSize + siblingSize > this.getTotalSize() && delta > 0) {
250-
paneSize = 0;
251-
siblingSize = this.getTotalSize();
247+
siblingSize = this.getTotalSize() - paneSize;
248+
} else if (paneSize + siblingSize > this.getTotalSize() && delta > 0) {
249+
paneSize = this.getTotalSize() - siblingSize;
252250
}
253251

254252
if (this.pane.isPercentageSize) {

0 commit comments

Comments
 (0)