$set in afterStateUpdated () not working in v3 but worked in v2
I have the two fields below. I'm trying to update property_id when customer_id changes. This worked in v2 but doesn't work in v3.
afterStateUpdated is definitely being called and I can $set other fields.
Any ideas?
18 Replies
@Dan Harrin any idea on this? I’ve been sponsoring you on GitHub for over a year and would appreciate any help
hi
judging by the code, its fine and nothing has changed
what is the result of Customer::find($state)?->properties()->first()?->id
Maybe it's a statePath issue
are the relationship options being scoped by customer correctly
if they are siblings, no
but yeah, if this is in a repeater you might be right
@smashville are you sure they are on the same component level?
This returns the correct id
what is the wider context
are these fields really directly next to each other in the form
Yes and I removed the scope to test and it still didn’t work
Yes
please open an issue with a simple reproduction repository
did you try to change Reactive to
->live()
for some reason that helped me sometimesNo let me try that now
also
->live(true)
helped->live() and ->live()true didn't work
ok i figured something out. thought i tested this before but apparently not. if i remove the customer_id where clause from the property_id it works. so it's trying to set before the property select updates with new relationship options
live() === reactive()
live is just the new version that stays in line with livewire 3
GitHub
$set in afterStateUpdated on select with scoped relationship not wo...
Package filament/filament Package Version 3.0.42 Laravel Version 10.22.0 Livewire Version No response PHP Version 8.2.9 Problem description I'm trying to set the property select to the customer...
the bot closed it automatically because i only put "see reproduction repo" in steps to reproduce
please just write what file to look in etc
what url to visit
GitHub
$set in afterStateUpdated on select with scoped relationship not wo...
Package filament/filament Package Version 3.0.42 Laravel Version 10.22.0 Livewire Version No response PHP Version 8.2.9 Problem description I'm trying to set the property select to the customer...