© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
21 replies
Maagalhaes

TextInput does not add mask to field

Sorry for the bad english.

I have problems when I add a TextInput with mask, because the mask is not added. When inspecting an element in firefox I see that two blur and two input events are loaded, one from the filament and the other from the livewire, when I cancel the propagation of the livewire by inspecting the mask it works normally, but I haven't found a way to do that in the code.

I'm making use of the Resource, creating the TextInput.

public static function form(Form $form): Form
{
      return $form
        ->schema([
            Section::make('Dados Gerais')
                ->icon('heroicon-o-document-text')
                ->schema([
                    Select::make('user_id')
                        ->label('Responsável')
                        ->relationship('user', 'name')
                        ->required(),
                    TextInput::make('nome')
                        ->label('Nome Academia')
                        ->required()
                        ->maxLength(255),
                    TextInput::make('cnpj')
                        ->label('CNPJ')
                        ->mask('99.999.999/9999-99')
                        ->placeholder('99.999.999/9999-99')
                        ->required()
                        ->maxLength(18)
                ]),
                // other methods
          ]);
}
public static function form(Form $form): Form
{
      return $form
        ->schema([
            Section::make('Dados Gerais')
                ->icon('heroicon-o-document-text')
                ->schema([
                    Select::make('user_id')
                        ->label('Responsável')
                        ->relationship('user', 'name')
                        ->required(),
                    TextInput::make('nome')
                        ->label('Nome Academia')
                        ->required()
                        ->maxLength(255),
                    TextInput::make('cnpj')
                        ->label('CNPJ')
                        ->mask('99.999.999/9999-99')
                        ->placeholder('99.999.999/9999-99')
                        ->required()
                        ->maxLength(18)
                ]),
                // other methods
          ]);
}
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to use mask in TextInput
FilamentFFilament / ❓┊help
3y ago
How to validate a Mask TextInput?
FilamentFFilament / ❓┊help
3y ago
TextInput is not updates when mask active
FilamentFFilament / ❓┊help
3y ago
Mask TextInput to enter an IP address
FilamentFFilament / ❓┊help
3y ago