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

Use event.currentTarget and not this in handlers #471

Closed
ivmartel opened this issue Mar 18, 2018 · 0 comments
Closed

Use event.currentTarget and not this in handlers #471

ivmartel opened this issue Mar 18, 2018 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@ivmartel
Copy link
Owner

ivmartel commented Mar 18, 2018

Some frameworks seem to run event handlers in a different context than the one used in web pages. This changes the value of this. To make them safer, event handlers on the application should use the event parameter and its currentTarget to replace this (to which it usually points to as written in the HTML5 recommendations the-event-handler-processing-algorithm).

Inferred for Vue in Instance-Lifecycle-Hooks: this refers to the Vue instance.

Inferred for Angular in user-input; this refers to the component class.

Relates to #363 (and similar...).

@ivmartel ivmartel added the enhancement New feature or request label Mar 18, 2018
@ivmartel ivmartel added this to the 0.23.2 milestone Mar 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant