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

Input Mask not working #36

Open
lpeterke opened this issue May 20, 2024 · 4 comments
Open

Input Mask not working #36

lpeterke opened this issue May 20, 2024 · 4 comments
Labels
bug Something isn't working work in progress
Milestone

Comments

@lpeterke
Copy link

lpeterke commented May 20, 2024

Hi there,

I am trying out this package and want to use the input mask. However, there seems to be a bug:

Alpine Expression Error: Invalid regular expression: /[^0-9]/g: Unterminated character class

Expression: "$money($input, '', ',', ' ', 2)"

I didn't do anything special, just added the MoneyInput to a resource create form.

@pelmered
Copy link
Owner

Thank you for the report.
I would like some more instructions on how I can reproduce this.

Can you show me the exact code for the field and what changes you have made to the global configuration? Also maybe Filament version.

@cgunnels
Copy link

Hey @pelmered I'm running into the same issue. When I type or even on blur nothing happens. I believe this is because of these javascript/Alpine errors (screenshots attached). I can even type in letters and other characters. Here's my code:

Section::make('Pricing')->schema([
        MoneyInput::make('msrp')
            ->label('MSRP'),

        MoneyInput::make('retailPrice')
            ->label('Retail Price'),
  ])
  ->columns(4)
  ->collapsed(false),

Screenshot 2024-05-25 at 4 56 52 PM
Screenshot 2024-05-25 at 4 57 19 PM

@pelmered
Copy link
Owner

@cgunnels Thank you for the report. I will revisit and rewrite the mask in the coming weeks. I have some ideas for that.

Until then I would suggest that you disable the mask if you are using this in production.

@pelmered
Copy link
Owner

pelmered commented Jun 4, 2024

I'm currently working on a fix for this. I hope that I can get it out this week.

@pelmered pelmered added bug Something isn't working work in progress labels Jul 25, 2024
@pelmered pelmered added this to the 2.0 milestone Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working work in progress
Projects
None yet
Development

No branches or pull requests

3 participants