Skip to content

Commit b7d2ddf

Browse files
Merge branch '20.1.x' into bpachilova/number-cols-alignment-fix-16828-20.1.x
2 parents 835e09f + d10fce6 commit b7d2ddf

File tree

5 files changed

+72
-14
lines changed

5 files changed

+72
-14
lines changed

projects/igniteui-angular/src/lib/core/styles/components/input/_input-group-theme.scss

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
$material-box-top-padding: sizable(rem(16px), rem(20px), rem(24px));
6060
$material-border-top-padding: sizable(rem(8px), rem(12px), rem(16px));
6161

62-
$textarea-top-padding: map.get((
63-
'material': rem(0px),
62+
$textarea-padding: map.get((
63+
'material': sizable(rem(8px), rem(12px), rem(16px)),
6464
'fluent': sizable(rem(6px), rem(10px), rem(14px)),
6565
'bootstrap': sizable(rem(4px), rem(8px), rem(12px)),
6666
'indigo': sizable(rem(4px), rem(6px), rem(8px)),
@@ -1289,7 +1289,7 @@
12891289

12901290
%textarea-group-label--focused {
12911291
transform: translateY(0);
1292-
top: calc(#{$material-box-top-padding} / 4);
1292+
top: calc(#{$textarea-padding} / 4);
12931293
}
12941294

12951295
%textarea-group-label--filled--border,
@@ -1465,9 +1465,10 @@
14651465
resize: vertical;
14661466
overflow: hidden;
14671467
z-index: 1;
1468+
padding-block-end: $textarea-padding;
14681469

14691470
@if $material-theme {
1470-
padding: 0;
1471+
padding-block-start: 0;
14711472
}
14721473
}
14731474

@@ -2023,14 +2024,14 @@
20232024
}
20242025

20252026
%indigo-textarea {
2026-
padding-block: $textarea-top-padding 0;
2027+
padding-block: $textarea-padding;
20272028
padding-inline: pad-inline(rem(2px), rem(4px), rem(6px));
20282029
inset-block-end: rem(2px);
20292030
}
20302031

20312032
%fluent-textarea {
20322033
padding-inline: pad-inline(rem(8px));
2033-
padding-block: $textarea-top-padding 0;
2034+
padding-block: $textarea-padding;
20342035
}
20352036

20362037
%fluent-input-disabled {
@@ -2292,7 +2293,7 @@
22922293
);
22932294

22942295
&:is(textarea) {
2295-
padding-block: $textarea-top-padding 0;
2296+
padding-block: $textarea-padding;
22962297
}
22972298
}
22982299

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)