File tree Expand file tree Collapse file tree
projects/igniteui-angular/src/lib
core/styles/components/stepper Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
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 {
Original file line number Diff line number Diff 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' , ( ) => {
You can’t perform that action at this time.
0 commit comments