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

ResizeObserver #120

Merged
merged 5 commits into from
Apr 19, 2023
Merged

ResizeObserver #120

merged 5 commits into from
Apr 19, 2023

Conversation

mattaebersold
Copy link
Contributor

@weotch check this out. I found that ditching window.resize and using resize observer helps with the following issue:

  • carousel mounts
  • something other than window resizing causes it's dimensions to change
  • it would not re-calc, so slides would dock appropriately

With this resizeObserver, it listens for dimension changes on the el, rather than window, so it works the same as before, but additionally will re-calc when it changes separately from the window size

https://caniuse.com/resizeobserver

@codesandbox
Copy link

codesandbox bot commented Apr 13, 2023

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@cypress
Copy link

cypress bot commented Apr 13, 2023

Passing run #65 ↗︎

0 18 0 0 Flakiness 0

Details:

Update src/concerns/dimensions.coffee
Project: vue-ssr-carousel Commit: 1b12837da8
Status: Passed Duration: 04:33 💡
Started: Apr 19, 2023 11:36 PM Ended: Apr 19, 2023 11:40 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

Copy link
Member

@weotch weotch left a comment

Choose a reason for hiding this comment

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

Yeah, this seems smart 👍, just some little tweaks that you can batch apply within GitHub. Then I'll merge and tag it.

src/concerns/dimensions.coffee Outdated Show resolved Hide resolved
src/concerns/dimensions.coffee Outdated Show resolved Hide resolved
src/concerns/dimensions.coffee Outdated Show resolved Hide resolved
Co-authored-by: Robert Reinhard <robert.reinhard@bukwild.com>
@netlify
Copy link

netlify bot commented Apr 19, 2023

Deploy Preview for vue-ssr-carousel ready!

Name Link
🔨 Latest commit 086bcbc
🔍 Latest deploy log https://app.netlify.com/sites/vue-ssr-carousel/deploys/64407a947095720008b8a733
😎 Deploy Preview https://deploy-preview-120--vue-ssr-carousel.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

mattaebersold and others added 2 commits April 19, 2023 16:34
Co-authored-by: Robert Reinhard <robert.reinhard@bukwild.com>
Co-authored-by: Robert Reinhard <robert.reinhard@bukwild.com>
@mattaebersold
Copy link
Contributor Author

@weotch I've committed those suggestions

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.

2 participants