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