Can you access the search state in a create action?
Sorry if the title doesn't make much sense
I have a select like this
Is there a way to access what the user has typed in the select to be used as a default value in the
createOptionForm
?
$component->getState()
is null8 Replies
Did you try passing $state in to th eaction?
Sorry, what do you mean? I need the state in the form, not the action 🤔
There's some weird interactions with the
it can affect the state of the fom, but I'm having trouble getting the actual state of the select hmm
Hmm now that I think about it,
getState()
is wrong since this is the search, not the value of the select 🤔
Might not work... haven't checked the code.
Sorry, I wasn't clear in the original question - what I want to do is pre-fill the form with the text they're trying to search for.
So let's say they are searching for someone named
John
and they want to create one, the createOptionForm
would look something like this
which I don't think is possible.
Oh well, maybe some filament wizard has an idea oh how to access the search value
Might not work... haven't checked the code or if state works on the option form closure
Nope, doesn't work either 😦 I don't think 'state' is what I want in the first place since the search is not considered the state - it's something else that is not accessible at some point
well the state should be the value of the input.
Just access it via the livewire element?
Hmm I can't seem to find it :/ Not sure if the search is not passed down or if there's some DOM magic I can do to get it 🤔