Skip to content

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
@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