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

No more implicit base element #15

Closed
fregante opened this issue Dec 7, 2019 · 1 comment
Closed

No more implicit base element #15

fregante opened this issue Dec 7, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@fregante
Copy link
Owner

fregante commented Dec 7, 2019

An implicit document base element is convenient but not a good idea, like jQuery.live demonstrated at the time.

Before

delegate('.btn', 'click', event => {
    console.log(event.delegateTarget);
});

After

delegate(document.body, '.btn', 'click', event => {
    console.log(event.delegateTarget);
});

or rather

delegate('.container-not-body', '.btn', 'click', event => {
    console.log(event.delegateTarget);
});
@fregante fregante added the enhancement New feature or request label Dec 7, 2019
@fregante
Copy link
Owner Author

fregante commented Apr 7, 2020

Done in 7c9b6c3

Will be published in the next major, this week.

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