Support custom min widths for popovers

This commit is contained in:
Andrew Kingston 2024-02-19 16:28:23 +00:00
parent 433c3a6306
commit 602f35537d
3 changed files with 6 additions and 4 deletions

View File

@ -15,6 +15,7 @@ export default function positionDropdown(element, opts) {
align,
maxHeight,
maxWidth,
minWidth,
useAnchorWidth,
offset = 5,
customUpdate,
@ -28,7 +29,7 @@ export default function positionDropdown(element, opts) {
const elementBounds = element.getBoundingClientRect()
let styles = {
maxHeight: null,
minWidth: null,
minWidth,
maxWidth,
left: null,
top: null,

View File

@ -12,6 +12,7 @@
export let anchor
export let align = "right"
export let portalTarget
export let minWidth
export let maxWidth
export let maxHeight
export let open = false
@ -21,7 +22,6 @@
export let customHeight
export let animate = true
export let customZindex
export let handlePostionUpdate
export let showPopover = true
export let clickOutsideOverride = false
@ -86,6 +86,7 @@
align,
maxHeight,
maxWidth,
minWidth,
useAnchorWidth,
offset,
customUpdate: handlePostionUpdate,

View File

@ -124,11 +124,11 @@
align="left-outside"
bind:this={popover}
anchor={popoverAnchor}
maxWidth={600}
minWidth={0}
maxWidth={480}
maxHeight={300}
dismissible={false}
on:mouseenter={stopHiding}
on:mouseleave={hidePopover}
>
<div class="helper">
<Layout gap="S">