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

Trouble combining keyup event, key name and modificator "once" #2732

Closed
lozunoff opened this issue Mar 5, 2022 Discussed in #2730 · 0 comments
Closed

Trouble combining keyup event, key name and modificator "once" #2732

lozunoff opened this issue Mar 5, 2022 Discussed in #2730 · 0 comments

Comments

@lozunoff
Copy link
Contributor

lozunoff commented Mar 5, 2022

Discussed in #2730

Originally posted by lozunoff March 5, 2022
Hello!

An issue has been found combining the keyup event, key name, and "once" modifier.

<input x-on:keyup.enter.once="..." />

This example doesn't work.

Presumably the problem is related to the order in which modifiers are processed in the

if (modifiers.includes('once')) {
.

If you move the processing of the "once" modifier higher in the code (up to line 41) - everything is ok. Example:

https://github.com/lozunoff/alpine/blob/88691edde975387eb5b479db4f711527648717ad/packages/alpinejs/src/utils/on.js#L41

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

No branches or pull requests

2 participants