Skip to content

Commit

Permalink
MDL-83493 theme_boost: Fix popover triggering
Browse files Browse the repository at this point in the history
Popovers were not being closed when clicking elsewhere resulting in
multiple popovers open at the same time that cannot be closed. That
was happening because the trigger for popovers was set to "focus" and
"click" at the same time. This patch removes the "click" as trigger.
Also, adds the click event listener to show the popover and avoid the
problem described in MDL-82570, that caused this regression.
  • Loading branch information
roland04 committed Nov 19, 2024
1 parent 63205f0 commit de05373
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion theme/boost/amd/build/loader.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion theme/boost/amd/build/loader.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion theme/boost/amd/src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const enablePopovers = () => {
$('body').popover({
container: 'body',
selector: '[data-toggle="popover"]',
trigger: 'focus click',
trigger: 'focus',
whitelist: Object.assign(DefaultWhitelist, {
table: [],
thead: [],
Expand All @@ -77,6 +77,9 @@ const enablePopovers = () => {
$(e.target).popover('show');
}
});
document.addEventListener('click', e => {
$(e.target).closest('[data-toggle="popover"]').popover('show');
});
};

/**
Expand Down

0 comments on commit de05373

Please sign in to comment.