You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building a form that contains an action, I should be able to use the visibleOn() method on the action to only show the action on specified operations.
For example with the following code, I would expect the "Generate password" action to only be visible on the 'create' action.
Currently, the "Generate password" action is incorrectly shown on both the "Create" and "Edit" operation.
Calling visibleOn(), visible() or hidden() has no effect on the Action.
Expected behavior
I would expect the above example to only show the "Generate password" action on the "create" operation, because of the call to ->visibleOn(['create']).
Steps to reproduce
Create a Form
Add an Action to the form, and call ->visibleOn(['create']) on it
See that the Action is still visible on the Edit page.
Reproduction repository (issue will be closed if this is not valid)
toFormComponent() is an internal method for wrapping an action in a form component, and it is not documented. It is used by the Actions::make() form component as part of the rendering process.
As per the documentation, I suggest that you use Actions::make() to render actions in a form, otherwise I can't guarantee other things will work as you want them to either. Using this component will also unlock other features such as controlling action alignment.
Package
filament/forms
Package Version
v3.2.132
Laravel Version
v11.37.0
Livewire Version
v3.5.12
PHP Version
PHP 8.2.25
Problem description
When building a form that contains an action, I should be able to use the
visibleOn()
method on the action to only show the action on specified operations.For example with the following code, I would expect the "Generate password" action to only be visible on the 'create' action.
Currently, the "Generate password" action is incorrectly shown on both the "Create" and "Edit" operation.
Calling
visibleOn()
,visible()
orhidden()
has no effect on the Action.Expected behavior
I would expect the above example to only show the "Generate password" action on the "create" operation, because of the call to
->visibleOn(['create'])
.Steps to reproduce
Action
to the form, and call->visibleOn(['create'])
on itReproduction repository (issue will be closed if this is not valid)
https://github.com/danjohnson95/filament-issue
Relevant log output
No response
The text was updated successfully, but these errors were encountered: