From f7c1db5926279cacace49e97d8f7420228dd27ed Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Fri, 11 Aug 2023 11:59:40 +0100 Subject: [PATCH] focus input when popover opens --- .../DataTable/modals/CreateEditColumn.svelte | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 7c3e13f39a..537d34a735 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -12,7 +12,7 @@ OptionSelectDnD, Layout, } from "@budibase/bbui" - import { createEventDispatcher, getContext } from "svelte" + import { createEventDispatcher, getContext, onMount } from "svelte" import { cloneDeep } from "lodash/fp" import { tables, datasources } from "stores/backend" import { TableNames, UNEDITABLE_USER_FIELDS } from "constants" @@ -47,6 +47,7 @@ export let field + let mounted = false let fieldDefinitions = cloneDeep(FIELDS) let originalName let linkEditDisabled @@ -95,6 +96,7 @@ } else { editableColumn.name = "Column 01" } + focus = true } allowedTypes = getAllowedTypes() } @@ -413,16 +415,24 @@ } return newError } + + onMount(() => { + mounted = true + }) + + $: console.log(editableColumn.name) - - + {/if}