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

<sl-color-picker hoist> causes warning due to non-passive touchmove listener #2005

Closed
Assignees
Labels
bug Things that aren't working right in the library.

Comments

@theacodes
Copy link

Describe the bug

Using <sl-color-picker hoist> causes the following warning in Chrome:

lit-html.ts:2057 [Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

This originates from

private handleTouchMove(event: TouchEvent) {
. If the event handler doesn't need to be blocking, it could be addressed using:

@eventOptions({passive: true})
private handleTouchMove(event: TouchEvent)

If the event handler does need to be blocking, the warning can be silenced by explicitly specifying passive: false:

@eventOptions({passive: false})
private handleTouchMove(event: TouchEvent)

To Reproduce

Place a hoisted sl-color-picker on the page:

<sl-color-picker hoist></sl-color-picker>

And look at the developer console in Chrome.

Demo

https://codepen.io/theacodes/pen/ExzYGVj)

Browser / OS

  • OS: macOS 14.4.1 23E224 arm64
  • Browser: Chrome
  • Browser version: 124.0.6367.119 (Official Build) (arm64)
@theacodes theacodes added the bug Things that aren't working right in the library. label May 8, 2024
claviska added a commit that referenced this issue May 10, 2024
@claviska
Copy link
Member

Thanks for reporting this! The fix has been applied in d94acc6 and will be available in the next release.

@claviska claviska self-assigned this May 10, 2024
@theacodes
Copy link
Author

Thanks, @claviska, you rock!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment