jarek-foksa / xel

Xel - Widget toolkit for building native-like Electron and Web apps
https://xel-toolkit.org
Other
696 stars 61 forks source link

Popovers in <x-buttons> don't close #136

Open dbrnz opened 1 year ago

dbrnz commented 1 year ago

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>
jarek-foksa commented 1 year ago

I will fix it after I finish the migration to the new Popover API (https://github.com/jarek-foksa/xel/issues/130). The current implementation is rather convoluted and there are many edge cases where popovers are misbehaving or are misaligned.

dbrnz commented 1 year ago

Thanks!