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

Swiper with Virtual Slides Module Enabled is not in NgZone #4588

Closed
seanwu1105 opened this issue May 20, 2021 · 1 comment · Fixed by #4601
Closed

Swiper with Virtual Slides Module Enabled is not in NgZone #4588

seanwu1105 opened this issue May 20, 2021 · 1 comment · Fixed by #4601
Assignees
Labels

Comments

@seanwu1105
Copy link

seanwu1105 commented May 20, 2021

  • Swiper Version: 6.6.1
  • Platform/Target and Browser Versions: web

What You Did

When I use SwiperComponent for Angular with virtual slides module enabled [virtual]="true", all events trigered inside <ng-template swiperSlide></ng-template> does not run in NgZone. Since SwiperModule is officially and specifically supported for Angular framework, I think it should make sure all interfaces publicly exported should be handled in NgZone by default.

Here is a minimal sample project to demonstrate the problem. If the Stackblitz live demo does not work, see this GitHub repo directly.

Expected Behavior

The demo contains the expected behavior. The navigation with routerLink inside ng-template should run in NgZone to refresh DOM accordingly.

Peek 2021-05-20 15-09

Actual Behavior

The navigation with routerLink inside ng-template does not run in NgZone, which causes the DOM does not refresh correctly. You can see there are warnings regarding the navigation not running in NgZone.

Peek 2021-05-20 15-12

@vltansky
Copy link
Collaborator

@seanwu1105 should be fixed in #4601. You can try it a demo on master with npm run build and then ng serve

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.

2 participants