Giter Site home page Giter Site logo

onScroll event propagation about rfcs HOT 5 CLOSED

O4epegb avatar O4epegb commented on May 27, 2024
onScroll event propagation

from rfcs.

Comments (5)

gaearon avatar gaearon commented on May 27, 2024

If you'd like to file an RFC, please send a pull request.

from rfcs.

necolas avatar necolas commented on May 27, 2024

@O4epegb Yes this is indeed weird behavior. React also bubbles blur and focus, which requires the same mitigation strategy. These are old decisions in the early versions of ReactDOM, which makes it difficult to change the behavior of those event props going forward (as there is no straight-forward way to deprecate the existing behavior for a period of time). It's also difficult to automatically analyze code for dependencies on the non-standard behavior, and most apps will not have automated test coverage to catch UX/a11y regressions if the behavior changes.

Something a few of us (not the core team) have been working on is a new ReactDOM event API that's independent of the existing event props. This allows us to have a fresh start and undo some of these decisions. In the meantime, I think your mitigation strategy (or calling stopPropagation) is a suitable work-around.

from rfcs.

gaearon avatar gaearon commented on May 27, 2024

There's also media events that all have the same problem.

from rfcs.

theKashey avatar theKashey commented on May 27, 2024

I would not call it a problem.
You are getting an ability to observe more events, having an ability to understand should you react or not to those events as well.
The only real problem with even bubbling are portals, where user ability to understand a location of the event (one could traverse from target to currentTarget) is broken - facebook/react#14540

from rfcs.

O4epegb avatar O4epegb commented on May 27, 2024

It seems like that behaviour gonna be fixed in v 17.
facebook/react#19464
Should we close this issue now?

from rfcs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.