Open tomaskebrle opened 1 year ago
Start a new pull request in StackBlitz Codeflow.
Looks like js-dom doesn't implement IntersectionObserver? :thinking:
Would it be possible to mock IntersectionObserver in the same way that ResizeObserver is being mocked here: https://github.com/histoire-dev/histoire/commit/2d16838cc429b39ae1268a998eb3850d90c37074
for example:
window.IntersectionObserver = window.IntersectionObserver || class IntersectionObserver {
disconnect(): void { /* noop */ }
observe(_target: Element): void { /* noop */ }
unobserve(_target: Element): void { /* noop */ }
/* todo: check for other methods */
};
This solves a similar issue I have with components using Jarallax which relies on the IntersectionObserver API.
I can send a PR if needed.
Describe the bug
When you include an IntersectionObserver in your code the story fails to load wit the following error
Reproduction
https://stackblitz.com/edit/histoire-svelte3-starter-mqasfc?file=src/BaseButton.svelte
Stackblitz only shows
But when run locally i get the error above
System Info
Used Package Manager
pnpm
Validations