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

Receiving [Violation] warning on every render of ScrollContainer #81

Open
sean-s14 opened this issue Aug 7, 2023 · 0 comments
Open

Comments

@sean-s14
Copy link

sean-s14 commented Aug 7, 2023

Using:

"react-indiana-drag-scroll": "^3.0.3-alpha"

With the following component:

export default function App() {
  const [bool, setBool] = useState(false);

  return (
    <div style={{ padding: 10 }}>
      <button onClick={() => setBool((prev) => !prev)}>Re-render</button>
      <ScrollContainer className="scroll-container">
        {Array.from({ length: 20 }, (_, i) => (
          <div key={i} className="btn">
            {i}
          </div>
        ))}
      </ScrollContainer>
    </div>
  );
}

Every render of the ScrollComponent causes the following warning:

index.es.js:1 - [Violation] 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

Note

This does not happen in version 2.2.0

I have also tested this in a private window (i.e. no extensions or shields) and I still get the same problem.

Reproduce warning:
https://stackblitz.com/edit/stackblitz-starters-yuzvcb?file=src%2FApp.js

Note

The default console in stackblitz will not display these warnings. You have to use the console in your browsers devtools.

@sean-s14 sean-s14 changed the title Receiving [Violation] warning on every re-render of ScrollContainer Receiving [Violation] warning on every render of ScrollContainer Aug 7, 2023
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

1 participant