© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
F
Filament
•
3y ago
•
5 replies
Lukas
Focus on Action Modal open?
Hi
, is it possible to focus a form field after a action modal is opened
?
I use AlpineJS dispatch an Event which opens the Modal and I
'm able to pass in the name of the field which is needed to be focused
.
But I
'm not sure if it
's possible currently
, I know I can execute PHP code when the modal is opened
. However I probably need to execute some JS
.
I also tried using
->autofocus()
->autofocus()
on the form fields with a Closure that checks which field to focus
, like
:
->autofocus(fn() => $this->autofocus === 'field-name')
->autofocus(fn() => $this->autofocus === 'field-name')
But autofocus seems not to do anything in modals
.
Filament
Join
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
Open action modal
F
Filament / ❓┊help
3y ago
Open custom modal action on record click
F
Filament / ❓┊help
2y ago
Modal on action
F
Filament / ❓┊help
2y ago
Open url in modal action
F
Filament / ❓┊help
2y ago