julianwayu
Hidden Action and action modal not opening. But if remove hidden the modal works
Anything i add on top of the initial query.. stops my modals from working. even i do it as simple as
It works for pulling the right tasks. but the action buttons do not trigger a modal open
38 replies
Hidden Action and action modal not opening. But if remove hidden the modal works
Ok.. its def my relationship:
It does not like my
orWhere
that bring additional tasks..
if i remove that and just leave it like
then it works as expected. no idea why it would cause that though.38 replies
Hidden Action and action modal not opening. But if remove hidden the modal works
Ugh. What the hell. Ok. Thanks so much for trying out. I’m going to start a new project and try from scratch on something simple. Not clue what’s going on with my current project. Is very bizarre.
38 replies
Hidden Action and action modal not opening. But if remove hidden the modal works
I still think there is some bug or something weird happening with
authorize()
, hidden()
and visible()
i have done a bunch of tests.
can you do me a huge favor @Kymset can you do the inverse of your test:
so instead of
->hidden(fn ($record): bool => $record->id % 2 === 0)
do
->hidden(fn ($record): bool => $record->id % 2 != 0)
When i do the inverse the modal does not show on the active actions.
but if i leave it like you originally did. it works fine and i cant for the life of me figure it out why..38 replies
Hidden Action and action modal not opening. But if remove hidden the modal works
@Dennis Koch was looking for other ways to accomplish what i want. Quick question, have you guys considered having actions accept a callback? somehting like this:
This would be really nice, so that instead of relying on hiding stuff via the actions themselves, we can just take care of building the actions and maybe even caching them before hand and would also feel a little more clean
or maybe there is already a way to accomplish something similar that I might be missing.
38 replies
Hidden Action and action modal not opening. But if remove hidden the modal works
ok. thanks Dennis for your help. i'm going to keep trying things. will report. need to investigate how the callable inside the hidden works. maybe that can give me some insight to the problem
38 replies
Hidden Action and action modal not opening. But if remove hidden the modal works
let me double check all that. not fully sure i understand how to check it. but let me try. lol
What's weird is why this works:
->hidden(fn ($record): bool => $record->id % 2 === 0)
but not when i moved the same logic to a method inside the record?
38 replies
Hidden Action and action modal not opening. But if remove hidden the modal works
The click button runs. as I can see the requests. when the button is not hidden. but the modal does not appear. The return of the canAction() is as expected since things are getting hidden and showned as expected. the problem is the action button not triggering the modal.
38 replies
Hidden Action and action modal not opening. But if remove hidden the modal works
So.. i moved @Kymset hidden test logic into the canAction in the record.
moved it inside the "record"
so the new hidden is like this
and same problem occurs.. even though before the hidden() that Kimset suggested to test with worked.
38 replies