Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search resets after selecting option in searchable multiple select #689

Open
slovenianGooner opened this issue Nov 17, 2024 · 0 comments
Open

Comments

@slovenianGooner
Copy link

Hi there! 👋

When using multiple select with search the value in the search input always resets after selecting an option. The expected behavior would be that the input stays filled so you can select multiple search values without having to search for it every time. Or at least this should be somehow configurable.

I may be missing something and this already exists, but it's not documented anywhere.

Please see the following Volt component as an example:

<?php

new class extends \Livewire\Volt\Component {
    public array $options = [
        'one' => 'One',
        'one-2' => 'One 2',
        'two' => 'Two',
        'two-2' => 'Two 2',
        'three' => 'Three',
        'three-2' => 'Three 3'
    ];

    public string $selectedOption = '';
}

?>
<div class="max-w-sm">
    <flux:select wire:model="selectedOption" variant="listbox" multiple searchable label="Values">
        @foreach($options as $value => $option)
            <flux:option value="{{ $value }}">{{ $option }}</flux:option>
        @endforeach
    </flux:select>
</div>

Also see the following video of the flow in action:

Screen.Recording.2024-11-17.at.10.00.38.mov

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant