-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Should onFocus/onBlur bubble or not? #1621
Comments
Related to #1611 |
At this moment the Repl is showing the latest stable version of Preact (and so are the docs), 10 is still in beta and this could be a quirk that we should fix. Thanks for making us aware. |
@JoviDeCroock But the plot thickens: It seems the same with |
...and with No bubbling of |
However I see |
Given that there are native A counter-argument is React compatibility if there are important third-party components which rely on the behaviour of |
I think that approach/attitude would make sense. But the feature of Additionally Preact's "close to the metal" event model would need to be documented a whole lot better than it is today. |
The change to the behaviour of
I agree. The section on event handling in https://preactjs.com/guide/differences-to-react is currently very brief. |
Hmm, so we can divide this into two issues I think? On one hand we need to expand the docs to better reflect the differences in bubbling, ... compared to react. |
I don't know if there are any already agreed-upon criteria for how far preact/compat should go to emulate React. A suggestion I have is that it would depend on whether the behaviour is critical for a popular third-party library, since that is a major use case for using preact/compat and the one where the app developer can't just make a simple change to their own code. |
The REPL is using Preact 7. |
I think this behaviour got introduced by accident as a side effect of supporting FWIW a compat fix would be to transform |
I have an issue exactly as @robertknight describes where we are using a 3rd party library that does not work due to onFocus not bubbling. Is this planned to be fixed? or considered to be a "Difference to react"? |
I'm confused about whether onFocus/onBlur events should bubble in preact, like they do in React.
In this example using preact 10.0.0-beta.1 they don't bubble https://codesandbox.io/embed/5wxk9zk7lx
...whereas in the Preact repl they do bubble https://preactjs.com/repl
So which example is correct Preact behavior?
If they should not bubble, then that fact really should be covered on the Differences to React page
... or even receive its own page about events and how
onChange
is different and how only some DOM event prop names may be camelCased (onClick
), while others must be lowercased (like:onfocusin
)Then also the REPL should be fixed to behave like "normal" Preact.
The text was updated successfully, but these errors were encountered: