Fix Dropdown and forms (#296)

Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
Alexander Platov
2021-11-04 12:17:59 +01:00
committed by GitHub
parent e3441737e5
commit 3eecfbf060
6 changed files with 36 additions and 15 deletions
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<script lang="ts">
import { onMount } from 'svelte'
import type { IntlString } from '@anticrm/platform'
@@ -34,6 +35,7 @@
let selected: Person | undefined
let btn: HTMLElement
let container: HTMLElement
let opened: boolean = false
const client = getClient()
@@ -54,11 +56,13 @@
<div class="flex-row-center container" bind:this={container}
on:click|preventDefault={() => {
btn.focus()
showPopup(UsersPopup, { _class, title, caption }, container, (result) => {
if (result) {
value = result._id
}
})
if (!opened) {
opened = true
showPopup(UsersPopup, { _class, title, caption }, container, (result) => {
if (result) { value = result._id }
opened = false
})
}
}}
>
<button class="focused-button btn" class:selected bind:this={btn}>