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

[v1.0.23] Multi select with tooltip: only opens on click between 'options selected' and the chevron down icon. #671

Open
lotje-kinable opened this issue Nov 14, 2024 · 0 comments

Comments

@lotje-kinable
Copy link

Hi!

I want to display the selected options with a tooltip. It works, but I need to click in between the 'options selected' and the chevron down icon, while without the tooltip, I can click anywhere to open the multi select. I've provided a screencast and a Volt component, for easy copy-paste.

multi.select.with.tooltip.mov
<?php
use Livewire\Attributes\{Layout, Title};
use Livewire\Volt\Component;

new
class extends Component {
    public $options;
    public $optionIds;

    public function mount()
    {

    $this->options = collect([
            (object)['id' => 1, 'name' => 'foo', 'price' => '10,0'],
            (object)['id' => 2, 'name' => 'bar', 'price' => '20,0'],
            (object)['id' => 3, 'name' => 'baz', 'price' => '30,0'],
        ]);
    }

}; ?>

<div class="space-y-28">

    <div>
        <flux:select wire:model='optionIds' variant="listbox" placeholder='Select option' multiple >
            @foreach($options as $option)
                <flux:option  wire:key="select-option-{{ $option->id }}" value="{{ $option->id }}">{{ $option->name }}</flux:option>
            @endforeach
        </flux:select>
    </div>

    <div>
        <flux:tooltip content="selected values">
            <flux:select wire:model='optionIds' variant="listbox" placeholder='Select options with tooltip' multiple >
                @foreach($options as $option)
                    <flux:option  wire:key="select-option-{{ $option->id }}" value="{{ $option->id }}">{{ $option->name }}</flux:option>
                @endforeach
            </flux:select>
        </flux:tooltip>
    </div>

</div>

Thanks in advance!

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