From 6ce85f2df7fdb2951b7cd1c9ed47119069eb3e44 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Fri, 15 May 2020 19:45:34 +0800 Subject: [PATCH] Fix modal open event bug --- .../bootstrap/modal-manager.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js index 21a8e0ce21..cc4122a373 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js @@ -95,8 +95,11 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f }); _$modal.on('shown.bs.modal', function () { - //focuses first element if it's a typeable input. + //focuses first element if it's a typeable input. var $firstVisibleInput = _$modal.find('input:not([type=hidden]):first'); + + _onOpenCallbacks.triggerAll(_publicApi); + if ($firstVisibleInput.hasClass("datepicker")) { return; //don't pop-up date pickers... } @@ -107,7 +110,6 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f } $firstVisibleInput.focus(); - _onOpenCallbacks.triggerAll(_publicApi); }); var modalClass = abp.modals[options.modalClass];