From 77ae8c6231dc674503e134cd4a0845340027a87f Mon Sep 17 00:00:00 2001 From: Elsio Sanchez <45974454+elsiosanchez@users.noreply.github.com> Date: Tue, 29 Oct 2024 22:57:59 -0400 Subject: [PATCH] Add Focus Lost to Commant Save (#2897) --- src/components/ADempiere/TabManager/index.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/ADempiere/TabManager/index.vue b/src/components/ADempiere/TabManager/index.vue index de9766f9b8..66fe3032e6 100644 --- a/src/components/ADempiere/TabManager/index.vue +++ b/src/components/ADempiere/TabManager/index.vue @@ -676,6 +676,18 @@ export default defineComponent({ }) } + function focusLost(currentTab) { + const { containerUuid } = currentTab + const columnName = store.getters.getFieldFocusColumnName + const currentFieldFocus = document.getElementById(`${columnName}`) + currentFieldFocus.__vue__.blur() + store.dispatch('notifyFocusLost', { + containerUuid, + columnName, + value: undefined + }) + } + function theAction(event) { const { currentTab } = store.getters.getContainerInfo switch (event.srcKey) { @@ -683,7 +695,10 @@ export default defineComponent({ newRecordTab(currentTab) break case 'save': - saveRecordTab(currentTab) + focusLost(currentTab) + setTimeout(() => { + saveRecordTab(currentTab) + }, 500) break case 'undo': undoChanges(currentTab)