diff --git a/src/directives/focus.js b/src/directives/focus.js index 5f0699ab1c..f43ea17490 100644 --- a/src/directives/focus.js +++ b/src/directives/focus.js @@ -5,8 +5,11 @@ 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() - }, 500) + }, 100) }, }