F
Filamentβ€’5mo 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β€’5mo ago
@CodeWithDennis Please have a look in this issue.
BlackShadow
BlackShadowβ€’5mo ago
Make sure that they are reactive/live, also please don't randomly tag me in issues πŸ˜›
Rinkesh
Rinkeshβ€’5mo 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β€’5mo 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β€’5mo ago
not worked in case of textarea and select field
LeandroFerreira
LeandroFerreiraβ€’5mo ago
share the whole code
Rinkesh
Rinkeshβ€’5mo ago
LeandroFerreira
LeandroFerreiraβ€’5mo ago
are you using resources or is it a custom page/livewire component?
Rinkesh
Rinkeshβ€’5mo ago
resource
LeandroFerreira
LeandroFerreiraβ€’5mo 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β€’4mo ago
@Rinkesh @Sarthak Garg
Want results from more Discord servers?
Add your server