Skip to content

Conversation

@matias-sandell
Copy link

Using event.preventDefault on the remaining clicks of the firstclick event and all lastclick events since there's no point in allowing default actions on them.

If I for example use the firstclick handler to to prevent multiple ajax requests I would have a event.preventDefault in it. But it would only be executed for the firstclick event, not the remaining click events.

Of course it could be solved by using something like this.

$el.on("firstclick click", function (e) {
    e.preventDefault();
    if (e.type == "firstclick") {
        // Do stuff
    }
);

But that doesn't seem like the right way to do it.

Now using event.preventDefault on the remaining clicks of the lastclick and firstclick events since there's no point in allowing default actions on them.
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