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?
11 Replies
@CodeWithDennis Please have a look in this issue.
Make sure that they are reactive/live, also please don't randomly tag me in issues π
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
not worked in case of textarea and select field
share the whole code
are you using resources or is it a custom page/livewire component?
resource
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 @Sarthak Garg