Fix issue preventing initial click of deleting relationship from working when relationship popover is open

This commit is contained in:
Andrew Kingston 2024-09-04 09:49:34 +01:00
parent 54e09267f1
commit 409580c787
No known key found for this signature in database
2 changed files with 9 additions and 1 deletions

View File

@ -208,6 +208,7 @@
// Toggles whether a row is included in the relationship or not // Toggles whether a row is included in the relationship or not
const toggleRow = async row => { const toggleRow = async row => {
hideRelationshipFields()
if (fieldValue?.some(x => x._id === row._id)) { if (fieldValue?.some(x => x._id === row._id)) {
// If the row is already included, remove it and update the candidate // If the row is already included, remove it and update the candidate
// row to be the same position if possible // row to be the same position if possible
@ -363,7 +364,12 @@
{/if} {/if}
{#if showRelationshipFields} {#if showRelationshipFields}
<GridPopover anchor={relationshipAnchor} maxWidth={400} offset={4}> <GridPopover
anchor={relationshipAnchor}
maxWidth={400}
offset={4}
clickOutsideOverride
>
<div class="relationship-fields"> <div class="relationship-fields">
{#each Object.entries(relationshipFields) as [fieldName, fieldValue]} {#each Object.entries(relationshipFields) as [fieldName, fieldValue]}
<div class="relationship-field-name"> <div class="relationship-field-name">

View File

@ -16,6 +16,7 @@
export let resizable = false export let resizable = false
export let wrap = true export let wrap = true
export let offset = 0 export let offset = 0
export let clickOutsideOverride
const { gridID } = getContext("grid") const { gridID } = getContext("grid")
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
@ -44,6 +45,7 @@
{resizable} {resizable}
{wrap} {wrap}
{offset} {offset}
{clickOutsideOverride}
portalTarget="#{gridID} .grid-popover-container" portalTarget="#{gridID} .grid-popover-container"
> >
<div <div