Select Form component not resetting value on change from different field

<?php

 Forms\Components\Select::make('vehicle_id')
                            ->label(__('drives.columns.vehicle'))
                            ->placeholder('Izaberite Vozilo')
                            ->options(fn (Get $get) => Vehicle::whereType($get('vehicle_type'))->pluck('licence_plate', 'id'))
                            ->required()
                            ->reactive()
                            ->preload()
                            ->live(onBlur: true)
                            ->native(false),


Forms\Components\ToggleButtons::make('vehicle_type')
                                ->label(__('drives.columns.vehicle_type'))
                                ->options(VehicleType::class)
                                ->afterStateUpdated(fn (Set $set) => $set('vehicle_id', null))
                                ->required(),


Picture:

If I click on Tip vozila (vehicle type) currently active is Kombi (Van) and if I click on Auto (car) I want to clear Vozilo (Vehicle) select field
Screenshot_2024-02-20_at_10.59.35.png
Was this page helpful?