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

x-mask: Cleanup of event listeners #3908

Merged
merged 1 commit into from
Dec 15, 2023
Merged

x-mask: Cleanup of event listeners #3908

merged 1 commit into from
Dec 15, 2023

Conversation

beholdr
Copy link
Contributor

@beholdr beholdr commented Dec 8, 2023

Hi,
Found a bug when using x-mask with Livewire. Problem is sometimes input changed by Livewire and mask directive intiated every time. Adding cleanup of event listeners fix this issue.

Unfortunately don't know how to make correct tests for this situation without LW part, but you can check it on this wirebox: https://wirebox.app/b/4kwle

To reproduce:

  1. Fill both inputs with 12345 string
  2. Click toggle button
  3. Try to enter 6 (to get 123456 string) in both fields. First field has weird behaviour, second field is OK.

Second field has patched version of mask plugin.

@ekwoka
Copy link
Contributor

ekwoka commented Dec 9, 2023

Definitely should be there!

I am a bit surprised to learn event listeners accept abort signals. That's pretty cool.

@calebporzio calebporzio merged commit 0115f8b into alpinejs:main Dec 15, 2023
1 check passed
@calebporzio
Copy link
Collaborator

Thank you!

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.

3 participants