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

Nested Vertical slides work, but slides are also shown in Horizontal Parent #4760

Closed
6 tasks done
dpsifr opened this issue Jul 14, 2021 · 0 comments · Fixed by #4785
Closed
6 tasks done

Nested Vertical slides work, but slides are also shown in Horizontal Parent #4760

dpsifr opened this issue Jul 14, 2021 · 0 comments · Fixed by #4785
Labels

Comments

@dpsifr
Copy link

dpsifr commented Jul 14, 2021

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/s/qw04s?file=/src/main.ts

Bug description

When I have nested vertical slides, everything works OK, but the nested slides also show up (double) in the parent slides.

`<swiper #outerSwiper direction="horizontal">
  <ng-template swiperSlide>
    <mat-card>
      <!-- additional content -->
    </mat-card>
  </ng-template>

  <ng-template swiperSlide>
    <mat-card>
      <!-- additional content -->
    </mat-card>
  </ng-template>

  <ng-template swiperSlide *ngFor="let slide of slides$ | async">
    <swiper #innerSwiper direction="vertical">
      <ng-container *ngFor="let innerSlide of slide.innerSlides>
        <ng-template swiperSlide>
          <mat-card class="papers stacks">
            <!-- additional content -->
          </mat-card>
        </ng-template>
      </ng-container>
    </swiper>
  </ng-template>
</swiper>`

When I get rid of all ng logic, I have the same problem which is why I was considering this a bug in Swiper.

<swiper direction="horizontal">
      <ng-template swiperSlide> test 1 </ng-template>
      <ng-template swiperSlide> test 2 </ng-template>
      <ng-template swiperSlide>
            <swiper direction="vertical">
                  <ng-template swiperSlide> test vertical 1 </ng-template>
                  <ng-template swiperSlide> test vertical 2 </ng-template>
           </swiper>
      </ng-template>
</swiper>

Expected Behavior

Nested vertical slides should not also appear in the parent horizontal slides.

Actual Behavior

Nested vertical slides are showing up both in the nested Swiper and the parent Swiper.

Swiper version

6.7.1

Platform/Target and Browser Versions

Chrome

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant