[FIX] website: forward clicks from the iframe to close dropdowns

See merge commit for more information.

task-2687506
This commit is contained in:
Younn Olivier
2022-06-24 10:28:07 +02:00
committed by qsm-odoo
parent b85c2a4cb1
commit 9d1f3b1d9b
@@ -201,6 +201,12 @@ export class WebsitePreview extends Component {
// The clicks on the iframe are listened, so that links with external
// redirections can be opened in the top window.
this.iframe.el.contentDocument.addEventListener('click', (ev) => {
if (!this.websiteContext.edition) {
// Forward clicks to close backend client action's navbar
// dropdowns.
this.iframe.el.dispatchEvent(new MouseEvent('click', ev));
}
const linkEl = ev.target.closest('[href]');
if (!linkEl) {
return;