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

Browser Console Violation #15

Open
Tihomir971 opened this issue Mar 26, 2024 · 1 comment
Open

Browser Console Violation #15

Tihomir971 opened this issue Mar 26, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Tihomir971
Copy link

Describe the feature in detail (code, mocks, or screenshots encouraged)

It would be nice te address Violation that is showing in browser console:
"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

What type of pull request would this be?

Enhancement

Provide relevant links or additional information.

No response

@Tihomir971 Tihomir971 added the enhancement New feature or request label Mar 26, 2024
@thez333
Copy link

thez333 commented Sep 20, 2024

I encountered this problem and here is the temporary solution I found: copy this into <script lang="ts"> here ...</script>

;(function () {
const originalAddEventListener = EventTarget.prototype.addEventListener

EventTarget.prototype.addEventListener = function (
  type,
  listener,
  options,
) {
  if (type === 'touchstart') {
    if (typeof options !== 'object' || options === null) {
      options = { capture: !!options, passive: true }
    } else {
      options.passive = true
    }
  }
  originalAddEventListener.call(this, type, listener, options)
}

})()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants