Closed elcapo closed 11 months ago
Please suggest some actionable steps that maintainers of Filament can take to fix this in Filament, that don't involve reporting this bug to Alpine.js on your behalf.
Please suggest some actionable steps that maintainers of Filament can take to fix this in Filament, that don't involve reporting this bug to Alpine.js on your behalf.
In the reproduction repository that I created exclusively for illustrating this issue, I included two use cases:
This, in principle, tells me that the issue is not in Alpine.js but in how Filament uses it. If this was an Alpine issue, I'd expect the Livewire component mask to also fail in Firefox (but it works).
I am facing the same problem in my app made laravel, livewire 3, alpinejs and alpine mask plugin. Masking does not work in Firefox. Apparently it's a problem with alpine in livewire 3, not sure.
I can confirm that, using only x-mask="(999) 999-9999" with Livewire 3 works fine on Safari and Chrome (on my Mac). It doesn't work live on Firefox, but it does transform to the mask on blur.
I pushed the normal Alpine script (//unpkg.com/alpinejs) to the component that I'm using the mask on, and live masking now works in all three browsers.
It's a LW bug. The reason you cant replicate it in the reproduction repository is because you're missing a wire:model
.
Add this to the LW class:
public $test = '';
And update the input:
<input wire:model="test" x-mask:dynamic="$money($input)">
Not working:
https://github.com/filamentphp/filament/assets/41773797/394c9cbd-1299-49b2-adf5-4808064c033a
We found a temporary fix by changing wire:model to
wire:model.onchange.debounce
Package
filament/filament
Package Version
v3.0.52
Laravel Version
v10.2.6
Livewire Version
v3.0.5
PHP Version
8.2.9
Problem description
Input masks are not working in Firefox. At least, not in some cases. But if a mask is added to an input outside a Filament resource, in a single Livewire component, the same mask works (also in Firefox).
Notes:
Filament
The input was created as in the input masking documentation:
... and it's being rendered properly, although the rendered input works in Firefox like it didn't have any mask:
See it in the reproduction repository.
Livewire
In the same repository, a Livewire version of the input was created:
... with the diference that this version, opened with the same Firefox version, respects the mask as expected.
See it in the reproduction repository.
Expected behavior
Masks would work in Firefox as they do when used in a Livewire (without Filament) component.
Steps to reproduce
The reproduction repository offers two different URLs that facilitate testing an input mask from both Filament and from a stripped Livewire component:
Reproduction repository
https://github.com/elcapo/text-input-mask-bug
Relevant log output
No response