Unsaved alerts show always pops up even if no changes made - `mask(RawJs::make('$money($input)'))`

Package Panel builder Package Version v3.2.63 How can we help you? Issue Description When using RawJs::make('$money($input)') with a field that has unsavedChangesAlerts(), the alert Changes you made may not be saved. is always displayed when navigating away from the page, even if no changes were made. Code Example
Forms\Components\TextInput::make('premium')
->nullable()
->numeric()
->inputMode('decimal')
->prefix(__('$'))
->rules([
'max:999999.99',
])
->mask(RawJs::make('$money($input)'))
->stripCharacters(','),
Forms\Components\TextInput::make('premium')
->nullable()
->numeric()
->inputMode('decimal')
->prefix(__('$'))
->rules([
'max:999999.99',
])
->mask(RawJs::make('$money($input)'))
->stripCharacters(','),
Question Is there a way to prevent Filament from showing the alert if no changes have been made?
No description
Solution:
I guess mask modifies the state on the client side and therefore it think it’s unsaved. Not sure whether we can solve this without increasing the complexity but you can still try submitting an issue.
Jump to solution
5 Replies
Dennis Koch
Dennis Kochβ€’4mo ago
Can you upgrade to the latest version and check whether it still happens? If yes, can you create an issue on GitHub? Does it happen only when you have ->mask() or ->stripCharacter()?
trollhunter (YOLO & πŸ’Ž πŸ™Œ)
Will give this a try and open an issue on GitHub if this still happens. The issue is when using ->mask() and not ->stripCharacters(',')
Solution
Dennis Koch
Dennis Kochβ€’4mo ago
I guess mask modifies the state on the client side and therefore it think it’s unsaved. Not sure whether we can solve this without increasing the complexity but you can still try submitting an issue.
trollhunter (YOLO & πŸ’Ž πŸ™Œ)
Thanks will create an issue. And if I get a chance will see if I can get a PR.
awcodes
awcodesβ€’4mo ago
I would say that mask is definitely modifying the state since it’s entangled via alpine.
Want results from more Discord servers?
Add your server