F
Filament16mo ago
qcol

$set and Placeholder content

I have a Select element, after selecting which I wanted to change the content of the Placeholder element. Select is ->live() however if I try in ->afterStateUpdated to give $set("my_placeholder",$new_data) - the placeholder content does not change. On TextInput fields $set works fine. How to do this?
Solution:
Placeholder::make('placeholder')
->content(fn (Get $get): string => $get('select') ?? '')
Placeholder::make('placeholder')
->content(fn (Get $get): string => $get('select') ?? '')
...
Jump to solution
2 Replies
Solution
LeandroFerreira
LeandroFerreira16mo ago
Placeholder::make('placeholder')
->content(fn (Get $get): string => $get('select') ?? '')
Placeholder::make('placeholder')
->content(fn (Get $get): string => $get('select') ?? '')
qcol
qcolOP16mo ago
In fact, it also works dynamically the other way if Select is ->live(). Thank you!
Want results from more Discord servers?
Add your server