odoo/odoo#198526

Created by fw-bot
Merged at 0ed94df19fe83c6aa7b055f8a19f2ceafbfaaa2a

Statuses:

label
odoo-dev:saas-18.2-16.0-opw-4505962-fix_cursor_navigation-wasa-417498-fw
head
9024929679e643e1b11ef74457eed0f9d2997adb
merged
3 months ago by Walid Sahli (wasa)
odoo/odoo
16.0 #195704
17.0 #198391
saas-17.4 #198471
18.0 #198483
saas-18.1 #198501
saas-18.2 #198526
saas-18.3
master #198554

[FW][FIX] web_editor: prevent unnecessary `feff` wrapping in links

Problem:
Wrapping links with feff chars allows placing the cursor
at their inner or outer edge. However, if the parent is
contenteditable=false, this behavior is unnecessary since
navigation outside the link is already blocked.

Example:
<div contenteditable=false>/ZWS/<a contenteditable=true>
/ZWS/ab[]c</a></div>
Pressing the left arrow key repeatedly places the cursor
at the start of a, before feff:
<div contenteditable=false>/ZWS/<a contenteditable=true>
[]/ZWS/abc</a></div>
This forces an extra left-arrow press to move past a,
which is redundant since only the link itself is editable.

Solution:
Wrap links with feff only if their parent element is
contenteditable=true.

Steps to Reproduce:
1. Add a Form snippet.
2. Focus on the "Submit" button.
3. Press the "Home" button to move the cursor to the start.
4. Press the right arrow key twice.
- Expected: Cursor moves after the first visible char.
- Issue: Cursor stops prematurely before the character.

opw-4505962


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #195704