### Purpose As stated in #9489 after clicking on a tab link to switch tabs in a modal you can no longer close the modal through clicking the ESC key unless you click anywhere on the modal to focus on it again. ### Testing - Click on a modal that has tabs like "Settings" or "Add Folder" and switch tabs then click on ESC. - Check if clicking outside of a modal in the backdrop should still close the modal. ### Demo https://github.com/user-attachments/assets/a010db9a-72f7-4160-a7db-ddfebffb4834
This commit is contained in:
@@ -16,6 +16,14 @@ angular.module('syncthing.core')
|
|||||||
},
|
},
|
||||||
link: function (scope, element, attrs) {
|
link: function (scope, element, attrs) {
|
||||||
|
|
||||||
|
$(element).on('click', function (event) {
|
||||||
|
const closestTabAnchor = event.target.closest('a[data-toggle="tab"]');
|
||||||
|
|
||||||
|
if (closestTabAnchor && closestTabAnchor.href.includes('#')) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// before modal show animation
|
// before modal show animation
|
||||||
$(element).on('show.bs.modal', function () {
|
$(element).on('show.bs.modal', function () {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user