Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
font-size: rem(12px);
height: $indicator-size;
width: $indicator-size;
min-width: $indicator-size;
white-space: nowrap;
border-radius: var-get($theme, 'border-radius-indicator');
color: var-get($theme, 'indicator-color');
Expand Down Expand Up @@ -633,10 +634,6 @@

%igx-stepper__step--start,
%igx-stepper__step--end {
%igx-stepper__step-indicator {
flex: 1 0 auto;
}

%igx-stepper__step-header {
@if $variant != 'fluent' {
padding: calc(#{$step-header-padding} / 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ describe('Rendering Tests', () => {
imports: [
NoopAnimationsModule,
IgxStepperSampleTestComponent,
IgxStepperLinearComponent
IgxStepperLinearComponent,
IgxStepperIndicatorNoShrinkComponent
]
}).compileComponents();
})
Expand Down Expand Up @@ -722,6 +723,23 @@ describe('Rendering Tests', () => {
stepper.horizontalAnimationType = 'fade';
testAnimationBehavior('fade', fix, false);
}));

it('should not shrink the step indicator in vertical orientation when titlePosition="end" and the title is very long', fakeAsync(() => {
const fixture = TestBed.createComponent(IgxStepperIndicatorNoShrinkComponent);
fixture.detectChanges();
tick();

const stepperInstance = fixture.componentInstance.stepper;
const indicator = stepperInstance.steps[0].nativeElement.querySelector(`.${STEP_INDICATOR_CLASS}`) as HTMLElement;

const { minWidth } = getComputedStyle(indicator);
const { width, height } = indicator.getBoundingClientRect();

expect(minWidth).not.toBe('0px');
expect(minWidth).not.toBe('auto');
expect(Math.abs(width - height)).toBeLessThan(1.5);
expect(Math.abs(width - parseFloat(minWidth))).toBeLessThan(1.5);
}));
});

describe('Keyboard navigation', () => {
Expand Down Expand Up @@ -1378,3 +1396,32 @@ export class IgxStepperSampleTestComponent {
export class IgxStepperLinearComponent {
@ViewChild(IgxStepperComponent) public stepper: IgxStepperComponent;
}

@Component({
template: `
<div>
<igx-stepper #stepper [orientation]="'vertical'" [titlePosition]="'end'">
<igx-step [active]="true">
<span igxStepTitle>{{ longTitle }}</span>
<div igxStepContent>Content</div>
</igx-step>
<igx-step>
<span igxStepTitle>Short</span>
<div igxStepContent>Content</div>
</igx-step>
</igx-stepper>
</div>
`,
imports: [
IgxStepperComponent,
IgxStepComponent,
IgxStepTitleDirective,
IgxStepContentDirective
]
})
export class IgxStepperIndicatorNoShrinkComponent {
@ViewChild(IgxStepperComponent) public stepper: IgxStepperComponent;

public longTitle =
'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';
}
Loading