jarek-foksa/xel

Popovers in <x-buttons> don't close

dbrnz opened this issue · 2 comments

dbrnz commented

In the following, a popover opens when the respective button is toggled on, but the popover stays open when another button is clicked (and opens its popover) even though the first button is now toggled off (tracking = 1). Is this intended?

<x-buttons tracking="1" vertical>
    <x-button id="select" skin="dock">
        <x-icon href="./icons/iconset.svg#pointer"></x-icon>
        <x-tooltip><x-message>Select</x-message></x-tooltip>
    </x-button>
    <x-button id="draw-connection" skin="dock">
        <x-icon href="./icons/iconset.svg#draw-connection"></x-icon>
        <x-tooltip><x-message>Draw connection</x-message></x-tooltip>
        <x-popover style="--align: right" id="draw-connection-popover">
            <main>
                <cd-connection-options/>
            </main>
        </x-popover>
    </x-button>
    <x-button id="add-component" skin="dock">
        <x-icon href="./icons/iconset.svg#add-component"></x-icon>
        <x-tooltip><x-message>Add component</x-message></x-tooltip>
        <x-popover style="--align: right" id="add-component-popover">
            <main>
                <cd-component-libraries/>
            </main>
        </x-popover>
    </x-button>
</x-buttons>

I will fix it after I finish the migration to the new Popover API (#130). The current implementation is rather convoluted and there are many edge cases where popovers are misbehaving or are misaligned.

dbrnz commented

Thanks!