Skip to content

Make an original event context accessible as [$el] in events #11967

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

Closed
wants to merge 2 commits into from
Closed

Make an original event context accessible as [$el] in events #11967

wants to merge 2 commits into from

Conversation

thisYogesh
Copy link

@thisYogesh thisYogesh commented Mar 18, 2021

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

PR details:
Currently we don't have direct access to the original event context i.e. an element upon which event has been applied. This feature is kind of an alternative for ref but not complete replacement, of course, And I think people would like to use it.

Usage of this feature:

  • <div id="item" @click="handler($el)"></div>
  • Where $el is the respective element i.e. #item.

@thisYogesh thisYogesh closed this Mar 18, 2021
@thisYogesh thisYogesh reopened this Mar 18, 2021
@posva
Copy link
Member

posva commented Mar 18, 2021

Thank you for the proposal. I don't think we should add this: the $event holds already the target. If you think this should be added to Vue, you should open an RFC in our rfcs repository

@posva posva closed this Mar 18, 2021
@thisYogesh
Copy link
Author

Thanks for your response @posva!
I'm aware of $event and event target, but event target is not always the element upon which event is applied!

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.

2 participants