Skip to content

Implement event modifiers #1819

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

Merged
merged 12 commits into from
Oct 28, 2018
Merged

Implement event modifiers #1819

merged 12 commits into from
Oct 28, 2018

Conversation

Rich-Harris
Copy link
Member

This finishes the work started in #1641.

Adding legacy support for once and passive would be possible, but realistically it would entail some larger changes, so I've decided to kick the can down the road for now.

@Rich-Harris
Copy link
Member Author

This doesn't address custom events or component events; for now, modifiers will be silently ignored. That can be addressed in follow-up work. For components I'm not sure it makes sense; that should probably result in an error.

For custom events, modifiers could be passed to the event definition:

export default {
  events: {
    foo(node, callback, modifiers) {
      // ...
    }
  }
};

We'd just need to figure out whether modifiers should be an array, object or set. Not going to worry about it now though

@Rich-Harris Rich-Harris merged commit 54fe128 into master Oct 28, 2018
@Rich-Harris Rich-Harris deleted the gh-1088 branch October 28, 2018 18:21
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

Successfully merging this pull request may close these issues.

1 participant