Skip to content

Conversation

@cjw783
Copy link
Contributor

@cjw783 cjw783 commented Apr 23, 2025

Issue

Resize event occurs infinitely sometimes when panel height changes.

Details

  • Added isResizing flag to prevent resize event occurence while processing resize logic.
  • Changed resize logic condition to make it occur only if there is difference between size before resize and size after resize.
  • Added optimizeSizeUpdate option to skip unnecessary re-rendering of panels when resizing viewport.

@CLAassistant
Copy link

CLAassistant commented Apr 23, 2025

CLA assistant check
All committers have signed the CLA.

this._resizeObserver = resizeObserver;
} else {
window.addEventListener("resize", this._onResize);
window.addEventListener("resize", () => this._onResize([]));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the callback function of the event listener.

@cjw783 cjw783 marked this pull request as ready for review May 15, 2025 10:25
const resizeDebounce = flicking.resizeDebounce;
const maxResizeDebounce = flicking.maxResizeDebounce;

if (entries.length) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

성현님 작업과 겹치는 부분이 존재할 것 같습니다.

또한 entries[0]이 viewport가 아니게 될 가능성이 있으니 참고하시면 좋을 것 같습니다.
또한 entries[0].target을 반복적으로 사용하고 있기 때문에 상수 하나 지정해서 사용하시면 좋을 것 같습니다.

@coveralls
Copy link

coveralls commented May 16, 2025

Coverage Status

coverage: 82.574% (-0.03%) from 82.599%
when pulling 5661896 on cjw783:fix/resize-logic
into 7fc15c7 on naver:master.

Copy link
Contributor

@malangfox malangfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cjw783 cjw783 merged commit 513c57b into naver:master May 16, 2025
4 checks passed
cjw783 added a commit that referenced this pull request Jun 17, 2025
* feat: add resizeObservePanel option (#884)

* fix: apply ResizeObserver to camera and panels

* fix: unobserve removed panel when panel change

* fix: add defense code to check if element exists

* feat: add resizeObservePanel option

* fix: add defensive logic to getStyle

* chore: change resizeObservePanel to resizePanelObserve

* fix: add unobserve panel logic

* chore: update setup-node to v4

* feat: add optimizeSizeUpdate option (#918)

* fix: infinite resize

* chore: remove route for removed demo

* fix: prevent calling viewport.resize() when isResizing

* chore: add type info

* chore: add script to link core and framework for debug

* chore: create reference demo page

* fix: calculate resized size using getElementSize

* feat: add optimizeSizeUpdate option

* chore: disable eslint for helper script

* refactor: declare variable for resizeTarget

* test: changed import path to relative path

* fix: changed viewport resize condition

* chore: add comments

---------

Co-authored-by: jinwoo-choi-05 <[email protected]>

* refactor: change resizePanelObserve to observePanelResize (#919)

* chore(release): Release 4.13.1

* chore(release): release packages

* chore(release): merge 4.13.1-rc

* feat: implement flicking state api core

* test: flicking-state unit test

* test: fix failed test

* fix: change geProgress logic

* feat: implement react flicking state api

* feat: impletment flickingStateApi for vue2, vue3

* feat: import flickingStateAPi

* feat: add scrollProgress state

* chore: update demo

* feat: update scrollProgress on move

* test: add progress test

* chore: refactor interface

---------

Co-authored-by: malangfox <[email protected]>
Co-authored-by: jinwoo-choi-05 <[email protected]>
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

Successfully merging this pull request may close these issues.

5 participants