Skip to content

Set focus on a form field after action #15459

Answered by leandrocfe
MagicDidou asked this question in Help
Discussion options

You must be logged in to vote
TextInput::make('designation')
    ->id('designation')
    ...
use Filament\Pages\Page;
..

Actions\Action::make('Ajouter')
    ->action(function () { ... })
    ->after(function (Page $livewire) {
        $livewire->js('document.getElementById(\'designation\').focus()');
    })

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@MagicDidou
Comment options

@MagicDidou
Comment options

Answer selected by MagicDidou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants