Tuesday, March 19, 2024
1 change · saas-17.1
Enhancements to existing features
This update enhances the text highlighting feature across Odoo's website and web editor, making it more reliable and visually consistent. Specifically, it fixes an issue where highlights were visible even when scrolling, and streamlines the code for better performance and maintainability.
Original PR description
The goal of this PR is to improve the current text highlight system by adding the following updates: - Move the highlight option's related CSS ([data-set-text-highlight]) to website. - Update the…
The goal of this PR is to improve the current text highlight system by adding the following updates: - Move the highlight option's related CSS ([data-set-text-highlight]) to website. - Update the `selectStyle` options to handle the default "currentColor" value. - Force to hide the highlight options overlay opacity on scroll. - Remove the dead code of `getDOMRectWidth()` (used in older versions to compare text content width on page load). - The `o_text_highlight_item_dirty` class is no longer used to adapt non-detected highlight items (the highlight mutation observer was tweaked to detect and adapt the new highlight items added to the DOM after editors commands. E.g. after the `oEnter()` command). - The editor's code (`_handleTextOptions()`) will only set text highlight classes and activate the snippet. Highlight DOM adaptations (multi-line detection, setting SVGs...) are done by the public widget. - A `z-index:` CSS (used to keep the highlight SVG visible and behind the text at the same time) is replaced by a more appropriate `isolation: isolate;`. - Only use one global `resizeObserver` to adapt the text highlights on resize. - The text highlight effects list was updated. task-3285817 Forward-Port-Of: odoo/odoo#142968