Skip to content

Commit 99be5ea

Browse files
authored
fix(angular): setElement call updateInitSwiper bug (#5296)
* fix(angular): setElement call updateInitSwiper bug
1 parent 090b42a commit 99be5ea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/angular/src/swiper.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,8 @@ export class SwiperComponent implements OnInit {
459459
) {}
460460

461461
private _setElement(el: ElementRef, ref: any, update: string, key = 'el') {
462-
if (ref && el && el.nativeElement) {
462+
if (!ref && !el) return;
463+
if (el.nativeElement) {
463464
if (ref[key] === el.nativeElement) {
464465
return;
465466
}

0 commit comments

Comments
 (0)