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

fix: issue 426, add mock ResizeObserver to dom #664

Merged
merged 2 commits into from Jan 25, 2024

Conversation

filiphazardous
Copy link
Contributor

@filiphazardous filiphazardous commented Jan 18, 2024

Description

Add mock ResizeObserver to DOM after jsdom initialization to fix issue #426

Additional context

Using the @formkit/autoanimate module makes stories fail on load, since ResizeObserver is missing. The lib itself diligently checks if there is a window object available, before it tries to use it. I checked the relevant issue in Jsdom project ( jsdom/jsdom#3368 ), but most use cases there seemed to be with testing. For those cases, it makes sense to add your own mock, if you want to trigger observe in a test. For us, however, it seems a simple noop replacement will do the trick. Hence this PR


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • If it's a new feature, provide a convincing reason to add it. Ideally, you should open a suggestion issue first and have it approved before working on it.
  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link

stackblitz bot commented Jan 18, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Jan 18, 2024

Deploy Preview for histoire-examples-svelte3 ready!

Name Link
🔨 Latest commit 4c297eb
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-svelte3/deploys/65b2bc31696631000837082f
😎 Deploy Preview https://deploy-preview-664--histoire-examples-svelte3.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 configuration.

Copy link

netlify bot commented Jan 18, 2024

Deploy Preview for histoire-examples-vue3 ready!

Name Link
🔨 Latest commit 4c297eb
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-vue3/deploys/65b2bc31c02d6d0008294b80
😎 Deploy Preview https://deploy-preview-664--histoire-examples-vue3.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 configuration.

Copy link

netlify bot commented Jan 18, 2024

Deploy Preview for histoire-site ready!

Name Link
🔨 Latest commit 4c297eb
🔍 Latest deploy log https://app.netlify.com/sites/histoire-site/deploys/65b2bc3190df1700084845c8
😎 Deploy Preview https://deploy-preview-664--histoire-site.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 configuration.

Copy link

netlify bot commented Jan 18, 2024

Deploy Preview for histoire-controls ready!

Name Link
🔨 Latest commit 4c297eb
🔍 Latest deploy log https://app.netlify.com/sites/histoire-controls/deploys/65b2bc311cf89c00089dfe39
😎 Deploy Preview https://deploy-preview-664--histoire-controls.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 configuration.

Copy link

codesandbox bot commented Jan 18, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@Akryum Akryum merged commit 2d16838 into histoire-dev:main Jan 25, 2024
9 of 10 checks passed
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.

None yet

2 participants