Nested Disabled Checks
Is there something wrong with doing something like this:
Basically, I'm trying to use
disabled
on an entire Section and then again on specific parts of that section. It's behaving very odd. I'm getting Uncaught TypeError: Cannot read properties of null (reading '__livewire')
errors in the console. And the disable feature isn't working properly10 Replies
I am using Select components and the components would only disable if I removed
searchable()
Can you share the whole code please?
I'm using the Full Calendar plugin https://filamentphp.com/plugins/filament-fullcalendar
Filament
FullCalendar by Saade - Plugins - Filament
The Most Popular JavaScript Calendar as a Filament Widget 💛
what is the issue?
One issue seems to be that if the
Section
is disabled but I use searchable()
on the Select element, the disabled
is ignored
Sorry the Section piece was wrong but there is still an issue. Here is an example:
This disabled
check works properly. But if I add ->searchable()
it is no longer disabledIt can’t be searchable and disabled, making it searchable turns it into an alpine component and it has to be enabled for the js to interact with it.
Interesting... is there a way I can check if the component is disabled from the
->searchable()
option?
I want it to be searchable if it is enabled. But I also want to be able to disable it if necessary
Or do I have to pick one or the other before it is rendered?maybe a callback in searchable() that returns true or false based on if the $component->isDisabled()?
something like this:
This was great thank you
I forgot I could access the component with
$component
In my case I needed ->searchable(fn (Select $component) => !$component->isDisabled()),