Skip to content

Commit 1250010

Browse files
Merge branch 'master' into mkirkova/fix-16238
2 parents acea4ae + 9214b09 commit 1250010

4 files changed

Lines changed: 63 additions & 7 deletions

File tree

projects/igniteui-angular/core/src/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/grids/core/src/grid-mrl-navigation.service.ts

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

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

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,40 @@ describe('IgxGrid Multi Row Layout - Keyboard navigation #grid', () => {
301301
GridFunctions.verifyGridContentActiveDescendant(GridFunctions.getGridContent(fix), cell.nativeElement.id);
302302
});
303303

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

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

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

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

0 commit comments

Comments
 (0)