diff --git a/lib/focus.directive.js b/lib/focus.directive.js index 9a1c282..1e03262 100644 --- a/lib/focus.directive.js +++ b/lib/focus.directive.js @@ -269,6 +269,13 @@ exports.default = { focusElement.focus(); } }, + inserted: function (el, binding, vnode) { + if (vnode.elm) { + var focusElement = exports.navigationService.getFocusElementById(vnode.elm.id); + if (focusElement && focusElement.isFocus) + focusElement.focus(); + } + }, unbind: function (el, binding, vnode) { if (vnode.elm) { var focusElement = exports.navigationService.getFocusElementById(vnode.elm.id); diff --git a/src/focus.directive.ts b/src/focus.directive.ts index e429734..fbd86ec 100644 --- a/src/focus.directive.ts +++ b/src/focus.directive.ts @@ -294,6 +294,13 @@ export default { focusElement.focus(); } }, + inserted: (el: any, binding: any, vnode: VNode) => { + if (vnode.elm) { + let focusElement = navigationService.getFocusElementById((vnode.elm).id); + if (focusElement && focusElement.isFocus) + focusElement.focus(); + } + }, unbind: (el: any, binding: any, vnode: VNode) => { if (vnode.elm) { let focusElement = navigationService.getFocusElementById((vnode.elm).id);