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}> <div use:getAnchor on:click={openMenu}>
<slot name="control" /> <slot name="control" />
</div> </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> <Menu>
<slot /> <slot />
</Menu> </Menu>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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