nova-ajax-select
nova-ajax-select copied to clipboard
3 or more dependend selects > not resetting correctly
I've got multiple selects depending on eachother. Simplified example:
client location department user
User depends on department, department on location and location on client.
Bug
- Select a (dependend) value in each select
- Change the selected option in client (first select)
- Location is properly resetted and department disabled.
- User however still has the old values
code?
\Laravel\Nova\Fields\BelongsTo::make('Distributor', 'distributor', DistributorResource::class)
->rules('required');
\NovaAjaxSelect\AjaxSelect::make('Client', 'client_id')
->get(config('nova.path') . "/orglevel/distributors/{distributor}/clients")
->parent('distributor');
\NovaAjaxSelect\AjaxSelect::make('Location', 'location_id')
->get(config('nova.path') . "/orglevel/clients/{client_id}/locations")
->parent('client_id');
\NovaAjaxSelect\AjaxSelect::make('Department', 'department_id')
->get(config('nova.path') . "/orglevel/locations/{location_id}/departments")
->parent('location_id');
\NovaAjaxSelect\AjaxSelect::make('User', 'user_id')
->get(config('nova.path') . "/orglevel/departments/{department_id}/users")
->parent('department_id');
Updated the code and changed the formatting. When i select all values and reset:
- Distributor -> client is resetted and location disabled. Department and User are not changed.
- Client -> location is resetted and department disabled. User is not changed.
@dillingham If you have the time, can you confirm that this is a legit bug? Or if it's not?