Skip to content

[FIX] html_editor: link popover not hidden on clicking other element #4762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master-mysterious-egg-next
Choose a base branch
from

Conversation

dabo-odoo
Copy link

@dabo-odoo dabo-odoo commented May 21, 2025

Before this commit clicking on certain elements with a link popover
open would not cause the link popover to close.

Steps to reproduce:

  • go to the website homepage
  • open the editor
  • click on any top menu links like Home or Contact Us
  • click on the user dropdwon in the topbar (usually Administrator)
  • the popover from the first click is still open

After the change clicking anywere that's not the popover's current
link will cause the popover to close.

@robodoo
Copy link

robodoo commented May 21, 2025

This PR targets the un-managed branch odoo-dev/odoo:master-mysterious-egg-next, it needs to be retargeted before it can be merged.

@ged-odoo ged-odoo force-pushed the master-mysterious-egg-next branch from 6e36b56 to 48edd7d Compare May 22, 2025 07:31
@dabo-odoo dabo-odoo force-pushed the master-mysterious-egg-dabo-link-popover-not-disappearing-on-click-other-element branch 2 times, most recently from abddce2 to 9930a96 Compare May 22, 2025 11:42
…ement

Before this commit clicking on certain elements with a link popover
open would not cause the link popover to close.

Steps to reproduce:
- go to the website homepage
- open the editor
- click on any top menu links like Home or Contact Us
- click on the user dropdwon in the topbar (usually Administrator)
- the popover from the first click is still open

After the change clicking anywere that's not the popover's current
link will cause the popover to close.
@dabo-odoo dabo-odoo force-pushed the master-mysterious-egg-dabo-link-popover-not-disappearing-on-click-other-element branch from 9930a96 to e6979cf Compare May 23, 2025 06:30
Copy link

@Jinjiu96 Jinjiu96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My feedback 🙏

Comment on lines +276 to +278
// Some elements can be clicked on without the selection being changed
// In those cases the overlay closing and opening must be done manually
this.addDomListener(this.editable, "click", (ev) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I think this is not the right place to fix the issue. The root cause is that when clicking some elements, the selection is not changed. Most likely, they prevented default on these elements. This influences all the selection change handlers.

For example, with the current fix, when you select text from Home button and the tool bar will popup, then you click the Administrator drop down, the toolbar stays open.

IMO, we should check why the selection change is prevented and make the fix there 🤔

Also we already have a click event listener, so if you still need to do the changes at click, you can probably move the code there :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants