Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carousel gets distorted and it is not working with the bs-stepper tab switching #269

Open
js-pankaj-rana opened this issue Dec 23, 2023 · 0 comments

Comments

@js-pankaj-rana
Copy link

js-pankaj-rana commented Dec 23, 2023

I have two stepper and every stepper has a CarouselComponent, when I move one step two second step, the UI get broken.

package details

"ngx-owl-carousel-o": "^16.0.0",
"bs-stepper": "^1.7.0",

Step 1 Image
Screenshot 2023-12-23 at 10 41 50 AM

Step 2 image
Screenshot 2023-12-23 at 10 42 02 AM

export class StepperOneComponent implements OnInit, OnDestroy {
@ViewChild('owlCarOne') owlCarouselOne: CarouselComponent;

public customOptions: OwlOptions = {
    mouseDrag: false,
    touchDrag: false,
    pullDrag: false,
   ...
  }
}
export class StepperTwoComponent implements OnInit, OnDestroy {
@ViewChild('owlCarTwo') owlCarouselTwo: CarouselComponent;
public customOptions: OwlOptions = {
    mouseDrag: false,
    touchDrag: false,
    pullDrag: false,
   ...
  }
}

html template of stepper (parent of carousel components)

<div id="stepper1" class="bs-stepper pt-4" #stepperRef>
      <div class="bs-stepper-header">
        <div class="step" data-target="#test-l-1">
          <button class="step-trigger">
            <span class="bs-stepper-circle">1</span>
            <span class="bs-stepper-label">Personal Information</span>
          </button>
        </div>
        <div class="line"></div>
        <div class="step" data-target="#test-l-2">
          <button class="step-trigger" [disabled]="disableStepper2">
            <span class="bs-stepper-circle">2</span>
            <span class="bs-stepper-label">Eligibility</span>
          </button>
        </div>
       </div>
      <div class="bs-stepper-content">
        <div id="test-l-1" class="content">
            <app-stepper-one></app-stepper-one>
         </div>
         <div id="test-l-2" class="content">
           <app-stepper-two></app-stepper-one>
         </div>
         </div>

StpperOne HTML template

<owl-carousel-o [options]="customOptions" #owlCarOne>
    <ng-template carouselSlide>
            <div class="card">
                some content
            </div>
            <div>        
                <button class="btn btn-primary btn-large" (click)="slideNext()" >Prev</button>
                <button class="btn btn-primary btn-large" (click)="slidePrev()">Next</button>
            </div>
    </ng-template>
    <ng-template carouselSlide>
        <div class="card">
            some content
        </div>

        <div>
            <button class="btn btn-primary btn-large" (click)="slideNext()" >Prev</button>
            <button class="btn btn-primary btn-large" (click)="slidePrev()">Next</button>
        </div>
    </ng-template>

Stepper One HTML template

<owl-carousel-o [options]="customOptions" #owlCarOne>
    <ng-template carouselSlide>
            <div class="card">
                some content
            </div>
            <div>        
                <button class="btn btn-primary btn-large" (click)="slideNext()" >Prev</button>
                <button class="btn btn-primary btn-large" (click)="slidePrev()">Next</button>
            </div>
    </ng-template>
    <ng-template carouselSlide>
        <div class="card">
            some content
        </div>
        <div>
            <button class="btn btn-primary btn-large" (click)="slideNext()" >Prev</button>
            <button class="btn btn-primary btn-large" (click)="slidePrev()">Next</button>
        </div>
    </ng-template>

Stepper Two HTML template


<owl-carousel-o [options]="customOptions" #owlCarTwo>
    <ng-template carouselSlide>
            <div class="card">
                some content
            </div>
            <div>        
                <button class="btn btn-primary btn-large" (click)="slideNext()" >Prev</button>
                <button class="btn btn-primary btn-large" (click)="slidePrev()">Next</button>
            </div>
    </ng-template>
    <ng-template carouselSlide>
        <div class="card">
            some content
        </div>

        <div>
            <button class="btn btn-primary btn-large" (click)="slideNext()" >Prev</button>
            <button class="btn btn-primary btn-large" (click)="slidePrev()">Next</button>
        </div>
    </ng-template>
</owl-carousel-o>

@js-pankaj-rana js-pankaj-rana changed the title Carousel is not working with the bs-stepper Carousel gets distorted and it is not working with the bs-stepper tab switching Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant