Add clickoutside handlers to options, long form and relationship cells
This commit is contained in:
parent
46b079497a
commit
5728cf9b2a
|
@ -1,5 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { onMount, tick } from "svelte"
|
import { onMount, tick } from "svelte"
|
||||||
|
import { clickOutside } from "@budibase/bbui"
|
||||||
|
|
||||||
export let value
|
export let value
|
||||||
export let focused = false
|
export let focused = false
|
||||||
|
@ -60,6 +61,7 @@
|
||||||
on:change={handleChange}
|
on:change={handleChange}
|
||||||
on:wheel|stopPropagation
|
on:wheel|stopPropagation
|
||||||
spellcheck="false"
|
spellcheck="false"
|
||||||
|
use:clickOutside={close}
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="long-form-cell" on:click={editable ? open : null} class:editable>
|
<div class="long-form-cell" on:click={editable ? open : null} class:editable>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { Icon } from "@budibase/bbui"
|
import { Icon, clickOutside } from "@budibase/bbui"
|
||||||
import { getColor } from "../lib/utils"
|
import { getColor } from "../lib/utils"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
|
|
||||||
|
@ -118,6 +118,7 @@
|
||||||
class:invertX
|
class:invertX
|
||||||
class:invertY
|
class:invertY
|
||||||
on:wheel={e => e.stopPropagation()}
|
on:wheel={e => e.stopPropagation()}
|
||||||
|
use:clickOutside={close}
|
||||||
>
|
>
|
||||||
{#each options as option, idx}
|
{#each options as option, idx}
|
||||||
{@const color = getOptionColor(option)}
|
{@const color = getOptionColor(option)}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { getColor } from "../lib/utils"
|
import { getColor } from "../lib/utils"
|
||||||
import { onMount, getContext } from "svelte"
|
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"
|
import { debounce } from "../../../utils/utils"
|
||||||
|
|
||||||
export let value
|
export let value
|
||||||
|
@ -284,7 +284,13 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if isOpen}
|
{#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">
|
<div class="search">
|
||||||
<Input
|
<Input
|
||||||
autofocus
|
autofocus
|
||||||
|
|
Loading…
Reference in New Issue