Skip to content

Commit 552ea27

Browse files
Merge branch '20.1.x' into mkirkova/fix-16238-20.1.x
2 parents 9127794 + 7ce9621 commit 552ea27

4 files changed

Lines changed: 64 additions & 7 deletions

File tree

projects/igniteui-angular/src/lib/core/styles/components/stepper/_stepper-theme.scss

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@
350350

351351
%igx-stepper__step-content-wrapper {
352352
margin-inline-start: $v-line-indent;
353+
padding-inline-start: $v-line-indent;
353354
position: relative;
354355
min-height: if($variant == 'indigo', rem(24px), rem(32px));
355356

@@ -364,12 +365,6 @@
364365
}
365366
}
366367

367-
[aria-selected='true'] {
368-
%igx-stepper__step-content-wrapper {
369-
padding-inline-start: $v-line-indent;
370-
}
371-
}
372-
373368
@if $variant == 'indigo' {
374369
[aria-selected='true'] {
375370
%igx-stepper__step-content-wrapper {

projects/igniteui-angular/src/lib/grids/grid-mrl-navigation.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ export class IgxGridMRLNavigationService extends IgxGridNavigationService {
355355

356356
private hasNextVerticalPosition(prev = false) {
357357
if ((prev && this.activeNode.row === 0 && (!this.isDataRow(this.activeNode.row) || this.activeNode.layout.rowStart === 1)) ||
358-
(!prev && this.activeNode.row >= this.grid.dataView.length - 1 && this.activeNode.column === this.lastColIndexPerMRLBlock())) {
358+
(!prev && this.activeNode.row >= this.grid.dataView.length - 1 &&
359+
this.activeNode.layout.rowStart === this.lastRowStartPerBlock())) {
359360
return false;
360361
}
361362
return true;

projects/igniteui-angular/src/lib/grids/grid/grid-mrl-keyboard-nav.spec.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { GridFunctions, GRID_MRL_BLOCK } from '../../test-utils/grid-functions.s
1212
import { CellType } from '../common/grid.interface';
1313
import { IgxColumnLayoutComponent } from '../columns/column-layout.component';
1414
import { IGridCellEventArgs, IgxColumnComponent } from '../public_api';
15+
import { IgxGridMRLNavigationService } from '../grid-mrl-navigation.service';
1516

1617
const DEBOUNCE_TIME = 30;
1718
const CELL_CSS_CLASS = '.igx-grid__td';
@@ -297,6 +298,40 @@ describe('IgxGrid Multi Row Layout - Keyboard navigation #grid', () => {
297298
GridFunctions.verifyGridContentActiveDescendant(GridFunctions.getGridContent(fix), cell.nativeElement.id);
298299
});
299300

301+
it('should not return an out of bounds row index when navigating down from the last layout row', () => {
302+
fix.componentInstance.data = SampleTestData.contactInfoDataFull().slice(0, 10);
303+
fix.componentInstance.colGroups = [{
304+
group: 'group1',
305+
columns: [
306+
{ field: 'ID', rowStart: 1, colStart: 1 },
307+
{ field: 'CompanyName', rowStart: 1, colStart: 2 },
308+
{ field: 'ContactName', rowStart: 1, colStart: 3 },
309+
{ field: 'ContactTitle', rowStart: 1, colStart: 4 },
310+
{ field: 'Address', rowStart: 1, colStart: 5 },
311+
{ field: 'City', rowStart: 2, colStart: 1 },
312+
{ field: 'Region', rowStart: 2, colStart: 2 },
313+
{ field: 'PostalCode', rowStart: 2, colStart: 3 },
314+
{ field: 'Phone', rowStart: 2, colStart: 4 },
315+
{ field: 'Fax', rowStart: 2, colStart: 5 }
316+
]
317+
}];
318+
fix.detectChanges();
319+
320+
const grid = fix.componentInstance.grid;
321+
const lastRowIndex = grid.dataView.length - 1;
322+
const navService = grid.navigation as IgxGridMRLNavigationService;
323+
const col = grid.getColumnByName('City');
324+
navService.setActiveNode({
325+
row: lastRowIndex,
326+
column: col.visibleIndex,
327+
layout: navService.layout(col.visibleIndex)
328+
});
329+
330+
const nextPos = navService.getNextVerticalPosition();
331+
expect(nextPos.row).toBe(lastRowIndex);
332+
expect(nextPos.column).toBe(navService.activeNode.column);
333+
});
334+
300335
it('should navigate up correctly', () => {
301336
fix.componentInstance.colGroups = [{
302337
group: 'group1',

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,32 @@ describe('Rendering Tests', () => {
738738
expect(Math.abs(width - height)).toBeLessThan(1.5);
739739
expect(Math.abs(width - parseFloat(minWidth))).toBeLessThan(1.5);
740740
}));
741+
742+
it('should not shift step content horizontally when navigating between steps in vertical mode', fakeAsync(() => {
743+
const indicatorFix = TestBed.createComponent(IgxStepperIndicatorNoShrinkComponent);
744+
indicatorFix.detectChanges();
745+
const indicatorStepper = indicatorFix.componentInstance.stepper;
746+
747+
const getContentWrapperStyles = (stepIndex: number) => {
748+
const contentWrapper = indicatorStepper.steps[stepIndex].nativeElement.querySelector('.igx-stepper__step-content-wrapper') as HTMLElement;
749+
const styles = window.getComputedStyle(contentWrapper);
750+
return {
751+
paddingInlineStart: styles.paddingInlineStart || styles.paddingLeft,
752+
marginInlineStart: styles.marginInlineStart || styles.marginLeft
753+
};
754+
};
755+
756+
const step0ActiveStyles = getContentWrapperStyles(0);
757+
758+
indicatorStepper.navigateTo(1);
759+
indicatorFix.detectChanges();
760+
tick(500);
761+
762+
const step0InactiveStyles = getContentWrapperStyles(0);
763+
764+
expect(step0InactiveStyles.paddingInlineStart).toBe(step0ActiveStyles.paddingInlineStart);
765+
expect(step0InactiveStyles.marginInlineStart).toBe(step0ActiveStyles.marginInlineStart);
766+
}));
741767
});
742768

743769
describe('Keyboard navigation', () => {

0 commit comments

Comments
 (0)