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

Implement canceling for event-less callbacks (e.g. onPress) #148

Open
mkrause opened this issue Feb 13, 2025 · 0 comments
Open

Implement canceling for event-less callbacks (e.g. onPress) #148

mkrause opened this issue Feb 13, 2025 · 0 comments

Comments

@mkrause
Copy link
Collaborator

mkrause commented Feb 13, 2025

There are are certain callbacks like onPress which do not take an Event instance. There is no way to cancel the rest of the event handler chain. It may be good to enable this. See for example SegmentedControl, where there is no way to stop the inner onPress handler from running.

Possibly also useful for event handlers that do take an Event? Because event.stopPropagation() right now is not respected by our own components, only by the browser.

Question: since there's no Event argument, how do we communicate this? Options:

  1. Add a (first) argument to all these callbacks that takes a basic Event-like argument.
  2. Use this: this.cancel().
@mkrause mkrause changed the title Event canceling for onPress callback Implement canceling for event-less callbacks (e.g. onPress) Feb 17, 2025
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