Rename date picker flag to be more meaningful and ensure action menus never shrink

This commit is contained in:
Andrew Kingston 2024-04-25 16:43:51 +01:00
parent ddbb6765ef
commit 8f058756c3
7 changed files with 18 additions and 10 deletions

View File

@ -38,7 +38,15 @@
<div use:getAnchor on:click={openMenu}>
<slot name="control" />
</div>
<Popover bind:this={dropdown} {anchor} {align} {portalTarget} on:open on:close>
<Popover
bind:this={dropdown}
{anchor}
{align}
{portalTarget}
resizable={false}
on:open
on:close
>
<Menu>
<slot />
</Menu>

View File

@ -38,7 +38,7 @@ export default function positionDropdown(element, opts) {
useAnchorWidth,
offset = 5,
customUpdate,
fitToScreen,
resizable,
wrap,
} = opts
if (!anchor) {
@ -82,7 +82,7 @@ export default function positionDropdown(element, opts) {
// Applies a dynamic max height constraint if appropriate
const applyMaxHeight = height => {
if (!styles.maxHeight && fitToScreen) {
if (!styles.maxHeight && resizable) {
styles.maxHeight = height
}
}

View File

@ -68,7 +68,7 @@
portalTarget={appendTo}
{anchor}
{align}
fitToScreen={false}
resizable={false}
>
{#if isOpen}
<DatePickerPopoverContents

View File

@ -25,7 +25,7 @@
export let handlePostionUpdate
export let showPopover = true
export let clickOutsideOverride = false
export let fitToScreen = true
export let resizable = true
export let wrap = false
$: target = portalTarget || getContext(Context.PopoverRoot) || ".spectrum"
@ -93,7 +93,7 @@
useAnchorWidth,
offset,
customUpdate: handlePostionUpdate,
fitToScreen,
resizable,
wrap,
}}
use:clickOutside={{

View File

@ -313,7 +313,7 @@
align="right"
on:close={close}
maxHeight={null}
fitToScreen
resizable
>
{#if editIsOpen}
<div class="content">

View File

@ -44,7 +44,7 @@
align={$visibleColumns.length ? "right" : "left"}
on:close={close}
maxHeight={null}
fitToScreen
resizable
>
<div class="content">
<slot />

View File

@ -13,7 +13,7 @@
export let maxHeight = PopoverMaxHeight
export let align = "left"
export let open = true
export let fitToScreen = false
export let resizable = false
export let wrap = true
const { gridID } = getContext("grid")
@ -40,7 +40,7 @@
{open}
{anchor}
{align}
{fitToScreen}
{resizable}
{wrap}
portalTarget="#{gridID} .grid-popover-container"
offset={0}