Comments (5)
If you'd like to file an RFC, please send a pull request.
from rfcs.
@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.
There's also media events that all have the same problem.
from rfcs.
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.
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)
- [Feature Request]: distinguish "what" and "when" dependencies in useEffect HOT 2
- [Feature Request] Return ref rather than forwardRef HOT 1
- the ability to check if something is function or class or an arrow function HOT 5
- npx-create-react-app creating a folder tempnodejsnpm HOT 2
- [Feature Request] Can we do some Static Analysis for diff with babel ? HOT 6
- Improving the RFC workflow process HOT 18
- useIf: Conditional hooks HOT 6
- Is useReducer an overengineering? HOT 10
- Improve profiling react applications HOT 1
- Introduce GUI tooling to speed up web application development HOT 1
- [React Server Components] Idea to simplify overall design HOT 11
- psql: could not connect to server: No such file or directory HOT 1
- [Question] The new JSX transform HOT 1
- [Feature Request]: Add array of updated deps indices to `useEffect` hooks arg HOT 1
- [Feature Request]: React Hooks `Equality` **AKA:** `[isEqual]` Callback HOT 3
- Functional Attribute/Prop Node HOT 2
- [Feature Request][eslint-plugin-react-hooks] no-ref-checks, display error when using useRef's return value as condition HOT 1
- [Feature Request]: useStateRef HOT 5
- Typo: 'exiting' might be 'existing' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rfcs.