Skip to content

Commit dc94bcb

Browse files
Merge branch 'master' into rivanova/fix-16649-master
2 parents cd331eb + 172d933 commit dc94bcb

3 files changed

Lines changed: 52 additions & 5 deletions

File tree

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name: Feature request
33
about: Suggest an idea for this project
44
title: ''
5+
type: Feature
56
labels: ':toolbox: feature-request,:new: status: new'
67
assignees: ''
78
projects: IgniteUI/16

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@
203203
font-size: rem(12px);
204204
height: $indicator-size;
205205
width: $indicator-size;
206+
min-width: $indicator-size;
206207
white-space: nowrap;
207208
border-radius: var-get($theme, 'border-radius-indicator');
208209
color: var-get($theme, 'indicator-color');
@@ -633,10 +634,6 @@
633634

634635
%igx-stepper__step--start,
635636
%igx-stepper__step--end {
636-
%igx-stepper__step-indicator {
637-
flex: 1 0 auto;
638-
}
639-
640637
%igx-stepper__step-header {
641638
@if $variant != 'fluent' {
642639
padding: calc(#{$step-header-padding} / 2);

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

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ describe('Rendering Tests', () => {
8585
imports: [
8686
NoopAnimationsModule,
8787
IgxStepperSampleTestComponent,
88-
IgxStepperLinearComponent
88+
IgxStepperLinearComponent,
89+
IgxStepperIndicatorNoShrinkComponent
8990
]
9091
}).compileComponents();
9192
})
@@ -722,6 +723,23 @@ describe('Rendering Tests', () => {
722723
stepper.horizontalAnimationType = 'fade';
723724
testAnimationBehavior('fade', fix, false);
724725
}));
726+
727+
it('should not shrink the step indicator in vertical orientation when titlePosition="end" and the title is very long', fakeAsync(() => {
728+
const fixture = TestBed.createComponent(IgxStepperIndicatorNoShrinkComponent);
729+
fixture.detectChanges();
730+
tick();
731+
732+
const stepperInstance = fixture.componentInstance.stepper;
733+
const indicator = stepperInstance.steps[0].nativeElement.querySelector(`.${STEP_INDICATOR_CLASS}`) as HTMLElement;
734+
735+
const { minWidth } = getComputedStyle(indicator);
736+
const { width, height } = indicator.getBoundingClientRect();
737+
738+
expect(minWidth).not.toBe('0px');
739+
expect(minWidth).not.toBe('auto');
740+
expect(Math.abs(width - height)).toBeLessThan(1.5);
741+
expect(Math.abs(width - parseFloat(minWidth))).toBeLessThan(1.5);
742+
}));
725743
});
726744

727745
describe('Keyboard navigation', () => {
@@ -1378,3 +1396,34 @@ export class IgxStepperSampleTestComponent {
13781396
export class IgxStepperLinearComponent {
13791397
@ViewChild(IgxStepperComponent) public stepper: IgxStepperComponent;
13801398
}
1399+
1400+
@Component({
1401+
template: `
1402+
<div>
1403+
<igx-stepper #stepper [orientation]="'vertical'" [titlePosition]="'end'">
1404+
1405+
<igx-step [active]="true">
1406+
<span igxStepTitle>{{ longTitle }}</span>
1407+
<div igxStepContent>Content</div>
1408+
</igx-step>
1409+
1410+
<igx-step>
1411+
<span igxStepTitle>Short</span>
1412+
<div igxStepContent>Content</div>
1413+
</igx-step>
1414+
</igx-stepper>
1415+
</div>
1416+
`,
1417+
imports: [
1418+
IgxStepperComponent,
1419+
IgxStepComponent,
1420+
IgxStepTitleDirective,
1421+
IgxStepContentDirective
1422+
]
1423+
})
1424+
export class IgxStepperIndicatorNoShrinkComponent {
1425+
@ViewChild(IgxStepperComponent) public stepper: IgxStepperComponent;
1426+
1427+
public longTitle =
1428+
'This is a very very very very very very very very very very very very very very very very very very very very very long step title that should not shrink the indicator';
1429+
}

0 commit comments

Comments
 (0)