Reactive Form Actions #15548
mmoollllee
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a Page Resource with a
publish_at
Date-Field.For CreatePage I want to display different Save-Actions. For Example:
publish_at
is unset there should be a Save as Draft-Action and a Save and Publish Now-Actionpublish_at
is set in the future, there should be a Save and Publish Later-ActionI tried the following but so far I'd have to inform the user after click, that what he's trying to do does not make sense. I'd like to build the Actions in a way, that the user can't even go wrong 😉
So I tried another approach to make the Date-Field
->live()
and use->visible(fn (?Get $get): bool => $get('publish_at') === null),
But that results in
Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization
So another idea could be to change the Actions from the Field via
->afterStateUpdated()
?Is there a chance to access the ActionButtons via Javascript?
Am I missing something or could this be a nice feature for Filament Forms in general?
Beta Was this translation helpful? Give feedback.
All reactions