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

TextInput loses masking upon uploading file in FileUpload #10352

Open
thethunderturner opened this issue Dec 17, 2023 · 6 comments
Open

TextInput loses masking upon uploading file in FileUpload #10352

thethunderturner opened this issue Dec 17, 2023 · 6 comments

Comments

@thethunderturner
Copy link
Contributor

thethunderturner commented Dec 17, 2023

Package

filament/filament

Package Version

v3.1.22

Laravel Version

10.37.3

Livewire Version

v3.3.0

PHP Version

8.2.13

Problem description

As the title says, when uploading the file the text input in the form loses it masking. For example, from "2,000" it goes to 2000.
The video below demonstrates the issue

2023-12-17_17-41-58.mp4

Expected behavior

The expected behavior is to remain in its masked state

Steps to reproduce

Add a numeric text input with a money mask with values > 1000, and after uploading a file, the TextInput will say 2000.

Reproduction repository

https://github.com/thethunderturner/TextInputBug

Relevant log output

No log output in this case

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar
@github-project-automation github-project-automation bot moved this to Todo in Roadmap Dec 17, 2023
@danharrin danharrin added this to the v3 milestone Dec 17, 2023
@danharrin danharrin added bug in dependency help wanted and removed bug Something isn't working labels Dec 17, 2023
@danharrin
Copy link
Member

Please try reproducing it outside of Filament with Filepond and Alpine.js mask on a single page. I don't think this is anything we can fix in Filament.

@iniznet
Copy link

iniznet commented Dec 18, 2023

I believe I've faced a similar issue in the past, depending on how you use the $money magic, the mask either gets lost or breaks when I upload or delete an image from FileUpload.

Alpine.js will remask it when you either input or move out of focus from the input.

Tried to replicate the issue using just Filepond and Alpine.js mask on Codepen, and it seems to be working fine there. You can take a look at the Mask Bug Codepen for reference.

I'm wondering if this discrepancy is caused by filament keeping the raw value instead of the masked one?

@danharrin
Copy link
Member

Have you tried a reproduction where the input is also using wire:model? There are definitely changes in behaviour there that I've seen before

@iniznet
Copy link

iniznet commented Dec 21, 2023

I haven't attempted it yet, it's a minor issue for me, so I don't go that far. I will try to when I have some time.

@zepfietje
Copy link
Member

Have you been able to do any more digging, @thethunderturner @iniznet?

@thethunderturner
Copy link
Contributor Author

Have you been able to do any more digging, @thethunderturner @iniznet?

Hey, I havent had time yet, but I can look at it next week :)

@polar-sh polar-sh bot added the Fund label Jun 3, 2024
@danharrin danharrin removed the fund label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

4 participants