Add clickoutside handlers to options, long form and relationship cells

This commit is contained in:
Andrew Kingston 2023-04-27 11:55:03 +01:00
parent 46b079497a
commit 5728cf9b2a
3 changed files with 12 additions and 3 deletions

View File

@ -1,5 +1,6 @@
<script>
import { onMount, tick } from "svelte"
import { clickOutside } from "@budibase/bbui"
export let value
export let focused = false
@ -60,6 +61,7 @@
on:change={handleChange}
on:wheel|stopPropagation
spellcheck="false"
use:clickOutside={close}
/>
{:else}
<div class="long-form-cell" on:click={editable ? open : null} class:editable>

View File

@ -1,5 +1,5 @@
<script>
import { Icon } from "@budibase/bbui"
import { Icon, clickOutside } from "@budibase/bbui"
import { getColor } from "../lib/utils"
import { onMount } from "svelte"
@ -118,6 +118,7 @@
class:invertX
class:invertY
on:wheel={e => e.stopPropagation()}
use:clickOutside={close}
>
{#each options as option, idx}
{@const color = getOptionColor(option)}

View File

@ -18,7 +18,7 @@
<script>
import { getColor } from "../lib/utils"
import { onMount, getContext } from "svelte"
import { Icon, Input, ProgressCircle } from "@budibase/bbui"
import { Icon, Input, ProgressCircle, clickOutside } from "@budibase/bbui"
import { debounce } from "../../../utils/utils"
export let value
@ -284,7 +284,13 @@
</div>
{#if isOpen}
<div class="dropdown" class:invertX class:invertY on:wheel|stopPropagation>
<div
class="dropdown"
class:invertX
class:invertY
on:wheel|stopPropagation
use:clickOutside={close}
>
<div class="search">
<Input
autofocus