1
0
Fork 0
mirror of synced 2024-10-02 01:56:57 +13:00

Fix issue with dates and blur grids when interacting with header cells

This commit is contained in:
Andrew Kingston 2024-04-25 14:26:01 +01:00
parent 8ac58fc0e7
commit 55014e304e
4 changed files with 16 additions and 7 deletions

View file

@ -179,6 +179,11 @@ export const stringifyDate = (
const day = `${value.date()}`.padStart(2, "0")
return `${year}-${month}-${day}T00:00:00.000`
}
// Otherwise use a normal ISO string with time and timezone
else {
return value.toISOString()
}
}
// Formats a dayjs date according to schema flags

View file

@ -104,6 +104,7 @@
}
const onMouseDown = e => {
ui.actions.blur()
if ((e.touches?.length || e.button === 0) && orderable) {
timeout = setTimeout(() => {
reorder.actions.startReordering(column.name, e)

View file

@ -3,10 +3,10 @@
import { Icon } from "@budibase/bbui"
import GridPopover from "../overlays/GridPopover.svelte"
const { visibleColumns, scroll, width, subscribe } = getContext("grid")
const { visibleColumns, scroll, width, subscribe, ui } = getContext("grid")
let anchor
let open = false
let isOpen = false
$: columnsWidth = $visibleColumns.reduce(
(total, col) => (total += col.width),
@ -15,8 +15,13 @@
$: end = columnsWidth - 1 - $scroll.left
$: left = Math.min($width - 40, end)
const open = () => {
ui.actions.blur()
isOpen = true
}
const close = () => {
open = false
isOpen = false
}
onMount(() => subscribe("close-edit-column", close))
@ -29,11 +34,11 @@
bind:this={anchor}
class="add"
style="left:{left}px"
on:click={() => (open = true)}
on:click={open}
>
<Icon name="Add" />
</div>
{#if open}
{#if isOpen}
<GridPopover
{anchor}
align={$visibleColumns.length ? "right" : "left"}

View file

@ -32,7 +32,6 @@ export const createActions = context => {
scroll,
bounds,
stickyColumn,
ui,
maxScrollLeft,
width,
} = context
@ -45,7 +44,6 @@ export const createActions = context => {
const $visibleColumns = get(visibleColumns)
const $bounds = get(bounds)
const $stickyColumn = get(stickyColumn)
ui.actions.blur()
// Generate new breakpoints for the current columns
let breakpoints = $visibleColumns.map(col => ({