Prioritized event handlers
Michael Strauß
michaelstrau2 at gmail.com
Thu Oct 26 02:06:21 UTC 2023
> - The consumed flag doesn't change any other behavior? Consumed events
> only are passed to handlers at the same level, but are not bubbled up
> (or captured down); having consumed events not be passed to event
> handlers (even at the same level) seems like a more sane default for sure
I pulled on this string a little bit more and decided to remove the
`EventHandlerPolicy` record from the API, because I think the
`EventHandlerPolicy.handleConsumedEvents` toggle is not required. Have
a look at the PR to see the simplified API:
https://github.com/openjdk/jfx/pull/1266
While the current behavior of JavaFX events is strange with regards to
handler invocation for consumed events, it doesn't need to be solved
with the priority API. Here's an interesting thing: if I simply don't
invoke any event handlers for an event that is already consumed, no
tests break. This suggests to me that the current behavior is an
oversight rather than a purposeful implementation, and we could change
it in the future.
More information about the openjfx-dev
mailing list