Skip to content

Commit 5a2804a

Browse files
author
jinwoo-choi-05
committed
fix: prevent calling viewport.resize() when isResizing
1 parent 16c2f20 commit 5a2804a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Flicking.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,8 @@ class Flicking extends Component<FlickingEvents> {
17151715
* @return {this}
17161716
*/
17171717
public async resize(): Promise<void> {
1718+
if (this._isResizing) return;
1719+
17181720
this._isResizing = true;
17191721

17201722
const viewport = this._viewport;

src/core/AutoResizer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ class AutoResizer {
7575

7676
const beforeSize = {
7777
width: flicking.viewport.width,
78-
height: flicking.viewport.height,
78+
height: flicking.viewport.height
7979
};
8080

8181
const afterSize = {
8282
width: resizeEntryInfo.width,
83-
height: resizeEntryInfo.height,
83+
height: resizeEntryInfo.height
8484
};
8585

8686
// resize 이벤트가 발생했으나 이전과 width, height의 변화가 없다면 이후 로직을 진행하지 않는다.

0 commit comments

Comments
 (0)