File tree Expand file tree Collapse file tree
projects/igniteui-angular
core/src/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 @@ -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' , ( ) => {
You can’t perform that action at this time.
0 commit comments