wireui / wireui

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

Default selected value not working #867

Open ffaouzif opened 2 months ago

ffaouzif commented 2 months ago

Describe the bug A select component does not display selected values from livewire model component. And not make any change to the binded property.

View :

<x-select placeholder="Guard" :options="['Web', 'API']" wire:model="guard_name"  />

Component :

<?php

namespace App\Http\Livewire;
use Livewire\Component;

class Edit extends Component
{
    public $guard_name = "Web";

    public function render()
    {
        return view('livewire.edit');
    }
}

Expected behavior It should select "Web" option, but it does not.

Capture d’écran du 2024-02-25 02-21-19

Capture d’écran du 2024-02-25 02-22-13-2

Dependencies

vlados commented 1 month ago

Any ideas why this bug occur? Possible solution?