From f5baa9f43221c4ca765754042c989172f6a6430c Mon Sep 17 00:00:00 2001 From: ochen1 <59662605+ochen1@users.noreply.github.com> Date: Tue, 26 Nov 2024 04:14:23 -0700 Subject: [PATCH 1/2] Remove 500ms focus delay from PropertyTitle Signed-off-by: ochen1 <59662605+ochen1@users.noreply.github.com> --- src/directives/focus.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/directives/focus.js b/src/directives/focus.js index 5f0699ab1c..d9f1fc71b0 100644 --- a/src/directives/focus.js +++ b/src/directives/focus.js @@ -5,8 +5,6 @@ export default { inserted(el) { - setTimeout(() => { - el.focus() - }, 500) + el.focus() }, } From e389eb0e4d81d56a67f738ed75c16d9fa14397f7 Mon Sep 17 00:00:00 2001 From: ochen1 <59662605+ochen1@users.noreply.github.com> Date: Tue, 26 Nov 2024 04:44:11 -0700 Subject: [PATCH 2/2] Re-attempt focus after 100ms delay for PropertyTitle Adding a delay ensures the element receives focus even if the directive is triggered before the component is fully mounted (e.g., during event creation). Signed-off-by: ochen1 <59662605+ochen1@users.noreply.github.com> --- src/directives/focus.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/directives/focus.js b/src/directives/focus.js index d9f1fc71b0..f43ea17490 100644 --- a/src/directives/focus.js +++ b/src/directives/focus.js @@ -6,5 +6,10 @@ export default { inserted(el) { el.focus() + // Adding a delay ensures the element receives focus even if the directive is triggered + // before the component is fully mounted (e.g., during event creation). + setTimeout(() => { + el.focus() + }, 100) }, }