From 77ac85b632a135154ac726eeebfdf90eac0786ea Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 15 Apr 2020 13:35:13 +0800 Subject: [PATCH] Add select2-bootstrap-modal-patch.js to Select2ScriptContributor. Resolve #3609 --- .../Mvc/UI/Packages/Select2/Select2ScriptContributor.cs | 1 + npm/packs/select2/abp.resourcemapping.js | 3 ++- npm/packs/select2/src/select2-bootstrap-modal-patch.js | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 npm/packs/select2/src/select2-bootstrap-modal-patch.js diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Select2/Select2ScriptContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Select2/Select2ScriptContributor.cs index 1e5f138f972..81696d5e711 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Select2/Select2ScriptContributor.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Select2/Select2ScriptContributor.cs @@ -12,6 +12,7 @@ public override void ConfigureBundle(BundleConfigurationContext context) { //TODO: Add select2.full.min.js or localize! context.Files.AddIfNotContains("/libs/select2/js/select2.min.js"); + context.Files.AddIfNotContains("/libs/select2/js/select2-bootstrap-modal-patch.js"); } } } diff --git a/npm/packs/select2/abp.resourcemapping.js b/npm/packs/select2/abp.resourcemapping.js index a264a19367b..f1205487b7c 100644 --- a/npm/packs/select2/abp.resourcemapping.js +++ b/npm/packs/select2/abp.resourcemapping.js @@ -3,6 +3,7 @@ "@node_modules/select2/dist/css/select2.min.css": "@libs/select2/css/", "@node_modules/select2/dist/js/select2.min.js": "@libs/select2/js/", "@node_modules/select2/dist/js/select2.full.min.js": "@libs/select2/js/", - "@node_modules/select2/dist/js/i18n/*.js": "@libs/select2/js/i18n/" + "@node_modules/select2/dist/js/i18n/*.js": "@libs/select2/js/i18n/", + "@node_modules/@abp/select2/src/*.*": "@libs/select2/js/" } } \ No newline at end of file diff --git a/npm/packs/select2/src/select2-bootstrap-modal-patch.js b/npm/packs/select2/src/select2-bootstrap-modal-patch.js new file mode 100644 index 00000000000..1fee6e798d4 --- /dev/null +++ b/npm/packs/select2/src/select2-bootstrap-modal-patch.js @@ -0,0 +1,4 @@ +/* + https://select2.org/troubleshooting/common-problems +*/ +$.fn.modal.Constructor.prototype._enforceFocus = function () { }; \ No newline at end of file