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

Fixed DropdownLabelsIntl layout #6277

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 25 additions & 26 deletions packages/ui/src/components/DropdownLabelsIntl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
export let shouldUpdateUndefined: boolean = true
export let minW0 = true

let container: HTMLElement
let container: HTMLButtonElement
let opened: boolean = false

$: selectedItem = items.find((x) => x.id === selected)
Expand Down Expand Up @@ -75,28 +75,27 @@
}
</script>

<div bind:this={container} class:min-w-0={minW0}>
<Button
{icon}
width={width ?? 'min-content'}
{size}
{kind}
{disabled}
{justify}
showTooltip={{ label, direction: labelDirection }}
on:click={openPopup}
>
<span slot="content" class="overflow-label disabled flex-grow text-left mr-2">
<Label
label={selectedItem ? selectedItem.label : label}
params={selectedItem ? selectedItem.params ?? params : params}
/>
</span>
<svelte:fragment slot="iconRight">
<DropdownIcon
size={'small'}
fill={kind === 'primary' && !disabled ? 'var(--primary-button-content-color)' : 'var(--theme-dark-color)'}
/>
</svelte:fragment>
</Button>
</div>
<Button
{icon}
width={width ?? 'min-content'}
{size}
{kind}
{disabled}
{justify}
showTooltip={{ label, direction: labelDirection }}
bind:input={container}
on:click={openPopup}
>
<span slot="content" class="overflow-label disabled flex-grow text-left mr-2">
<Label
label={selectedItem ? selectedItem.label : label}
params={selectedItem ? selectedItem.params ?? params : params}
/>
</span>
<svelte:fragment slot="iconRight">
<DropdownIcon
size={'small'}
fill={kind === 'primary' && !disabled ? 'var(--primary-button-content-color)' : 'var(--theme-dark-color)'}
/>
</svelte:fragment>
</Button>