wireui / wireui

TallStack UI components
https://v1.wireui.dev
MIT License
1.37k stars 167 forks source link

Page Scroll To Top Automatically After Selected #874

Open tranhuungan1990 opened 1 month ago

tranhuungan1990 commented 1 month ago

chrome-capture-2024-3-19

Livewire Component

public array $quanhuyen = [];
$tinhthanh = Province::get()->toArray();

public function updatedTinhThanh()
{
    $this->quanhuyen = District::select('id', 'name')->where('province_id', $this->tinh_thanh)->get()->toArray();
}

Blade View

<x-select
    label="Tỉnh/Thành phố"
    wire:model.live="tinh_thanh"
    :options="$tinhthanh"
    option-label="name"
    option-value="id"
/>

How to stop automatically scrolling to the top of the page? Thank you!