-
Notifications
You must be signed in to change notification settings - Fork 139
Fix/resize logic #918
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
Fix/resize logic #918
Conversation
src/core/AutoResizer.ts
Outdated
| this._resizeObserver = resizeObserver; | ||
| } else { | ||
| window.addEventListener("resize", this._onResize); | ||
| window.addEventListener("resize", () => this._onResize([])); |
There was a problem hiding this comment.
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.
src/core/AutoResizer.ts
Outdated
| const resizeDebounce = flicking.resizeDebounce; | ||
| const maxResizeDebounce = flicking.maxResizeDebounce; | ||
|
|
||
| if (entries.length) { |
There was a problem hiding this comment.
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을 반복적으로 사용하고 있기 때문에 상수 하나 지정해서 사용하시면 좋을 것 같습니다.
malangfox
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* 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]>
Issue
Resize event occurs infinitely sometimes when panel height changes.
Details
isResizingflag to prevent resize event occurence while processing resize logic.optimizeSizeUpdateoption to skip unnecessary re-rendering of panels when resizing viewport.