F
Filamentβ€’4w ago
Rinkesh

Textarea and select field disabled() issue

I have applied ->disabled(fn (Get $get): bool => $get('same_addr')) based on checkbox [same_addr] value , but when I checkbox checked then it disabled and again if I uncheck then textarea and select field not enable to edit. What is issue?
No description
11 Replies
Rinkesh
Rinkeshβ€’4w ago
@CodeWithDennis Please have a look in this issue.
BlackShadow
BlackShadowβ€’4w ago
Make sure that they are reactive/live, also please don't randomly tag me in issues πŸ˜›
Rinkesh
Rinkeshβ€’4w ago
Textarea::make('cur_address') ->label('Address') ->rows(2) ->cols(5) ->disabled(fn (Get $get): bool => $get('same_addr')) ->dehydrated() ->live() ->placeholder('Current Address'), Checkbox::make('same_addr') ->label('Same as Current Address?') ->afterStateUpdated( fn (Set $set, ?string $state, Get $get) => [ $set('per_address', ($state)? $get('cur_address'):'' ), ] ) ->live(), not working select and textarea not editable when unchecked
LeandroFerreira
LeandroFerreiraβ€’4w ago
->afterStateUpdated(
function (Forms\Set $set, ?string $state, Forms\Get $get) {
$set('per_address', $state ? $get('cur_address') : '');
}
)
->afterStateUpdated(
function (Forms\Set $set, ?string $state, Forms\Get $get) {
$set('per_address', $state ? $get('cur_address') : '');
}
)
Rinkesh
Rinkeshβ€’4w ago
not worked in case of textarea and select field
LeandroFerreira
LeandroFerreiraβ€’4w ago
share the whole code
LeandroFerreira
LeandroFerreiraβ€’4w ago
are you using resources or is it a custom page/livewire component?
Rinkesh
Rinkeshβ€’4w ago
resource
LeandroFerreira
LeandroFerreiraβ€’4w ago
console errors? there is no error in the code I think.. maybe you could provide a mini repo on Github to reproduce this issue..
Rinkesh
Rinkeshβ€’3w ago
@Rinkesh @Sarthak Garg