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

Expose event parameter #140

Merged
merged 2 commits into from May 17, 2021
Merged

Expose event parameter #140

merged 2 commits into from May 17, 2021

Conversation

blaumeise20
Copy link
Contributor

This PR adds the optional parameter event to all methods provided in options. This allows you to access the event target.

@sindresorhus
Copy link
Owner

What's the use-case?


You also need to update the readme and index.d.ts doc comments.

@blaumeise20
Copy link
Contributor Author

I fixed the documentation now.

The use case is very simple: You want to show different actions depending on the element you right-click on. Do you understand? For example: you click on an element in the sidebar and you get a different menu than clicking on an element in the main view.

@sindresorhus sindresorhus changed the title Expose event Expose event parameter May 17, 2021
@sindresorhus sindresorhus merged commit f4bd55f into sindresorhus:main May 17, 2021
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.

None yet

2 participants