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

Version 0.0.9 and 0.0.10 error with: Added non-passive event listener to a scroll-blocking 'touchstart' event. #11

Closed
forna opened this issue Oct 21, 2024 · 6 comments

Comments

@forna
Copy link

forna commented Oct 21, 2024

Version 0.0.8 works without issue, if I update to 0.0.9 or 0.0.10 the modal stops working and in the Chrome console I get the error:
Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952"

image

image

@forna forna changed the title Version 0.0.9 and 0.0.10 error with "Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952" Version 0.0.9 and 0.0.10 error with: Added non-passive event listener to a scroll-blocking 'touchstart' event. Oct 21, 2024
@robinmetral
Copy link
Owner

Hi, thanks for the report! Unfortunately I can't reproduce the issue, so it's difficult for me to pin this down. Are you also running into the bug on the demo page? Could you share a reproduction example that I could take a look at?

Bear in mind that this library is essentially a Svelte wrapper for Micromodal, so it doesn't really handle any of the events itself. The Chrome console warnings also may or may not be unrelated.1

Footnotes

  1. Looking at the issues on Micromodal, I can see a similar report from all the way back in 2020: https://github.com/ghosh/Micromodal/issues/327. It seems like it was addressed by following the Chrome suggestion (adding passive: true in https://github.com/ghosh/Micromodal/pull/478, and later reverted in https://github.com/ghosh/Micromodal/pull/488 because the fix introduced new problems.

@forna
Copy link
Author

forna commented Oct 22, 2024

I use Svelte 5. I am not sure how to reproduce code with external libs like micromodal in the Svelte 5 playground.
The demo page works fine.
I raised this issue more to know what was changed in version 0.0.9 that causes this behavior; 0.0.8 works fine.

@robinmetral
Copy link
Owner

The only client-side change between the two versions is this one: #8

What it does is basically upgrade micromodal from v0.4.8 to v0.4.10 (to fix upstream bugs), but to do this we had to work around a regression in v0.4.9 (which I reported upstream in ghosh/Micromodal#490).

Can you spot anything in there that might cause the issue? Again, I'd be happy to help debug, but that's difficult without a reproduction. What did you mean by "it stopped working"? Does your modal not open at all after the upgrade?

@forna
Copy link
Author

forna commented Oct 24, 2024

0.4.10 merges:
ghosh/Micromodal#488 - Remove { passive: true } from touchstart listener
that is known for causing this problem.
Putting back the { passive: true } to the touchstart listener would fix the issue.

The modal for me does not work at all, it becomes grey and unresponsive.
Anyway I don't want to spend too much time on this issue, I will keep using version 0.0.8.

@robinmetral
Copy link
Owner

Have to tested it to check that this actually solves the issue? Like I said earlier, looking at reports upstream I'm not sure that the Chrome console warning and the unresponsive modal are related. If this is the problem, we could look at how to solve it without introducing the other bugs that { passive: true } introduced upstream (referenced in the PR you linked).

I understand if you don't want to spend more time on this though. Would love to help more but it's hard for me to do anything without a possibility to reproduce. If you're happy with the status quo, feel free to close this issue!

@forna forna closed this as completed Oct 29, 2024
@forna
Copy link
Author

forna commented Oct 29, 2024

Thank you, I close it for now.

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

No branches or pull requests

2 participants