Skip to content

[FIX] html_editor: stage selection before deletion#264167

Closed
fw-bot wants to merge 1 commit into
odoo:masterfrom
odoo-dev:master-18.0-opw-6142055-preserve_selection_on_delete-wasa-524161-fw
Closed

[FIX] html_editor: stage selection before deletion#264167
fw-bot wants to merge 1 commit into
odoo:masterfrom
odoo-dev:master-18.0-opw-6142055-preserve_selection_on_delete-wasa-524161-fw

Conversation

@fw-bot
Copy link
Copy Markdown
Contributor

@fw-bot fw-bot commented May 12, 2026

Problem:
In some cases, undo restores the selection to an incorrect position.

Cause:
The selection state was not staged before the deletion started, leading to an inconsistent selection being restored during undo.

Solution:
Stage the selection before performing the deletion to ensure it can be restored to the correct position.

Steps to reproduce:

  • Go to To-Do → Create New.
  • Type something on the first line and press Enter.
  • Type something on the second line and apply styling to it.
  • Use the Up arrow key to move to the first line.
  • Remove a character.
  • Press Undo (Ctrl + Z).
  • Observe that the selection and toolbar appear on the second line.

task-6142055


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

Forward-Port-Of: #263164
Forward-Port-Of: #260630

Problem:
In some cases, undo restores the selection to an incorrect position.

Cause:
The selection state was not staged before the deletion started, leading
to an inconsistent selection being restored during undo.

Solution:
Stage the selection before performing the deletion to ensure it can be
restored to the correct position.

Steps to reproduce:
- Go to To-Do → Create New.
- Type something on the first line and press Enter.
- Type something on the second line and apply styling to it.
- Use the Up arrow key to move to the first line.
- Remove a character.
- Press Undo (Ctrl + Z).
- Observe that the selection and toolbar appear on the second line.

task-6142055

X-original-commit: b005d8d
@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented May 12, 2026

Pull request status dashboard

@fw-bot
Copy link
Copy Markdown
Contributor Author

fw-bot commented May 12, 2026

@walidsahli @dmo-odoo this PR targets master and is the last of the forward-port chain.

To merge the full chain, use

@robodoo r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label May 12, 2026
@walidsahli
Copy link
Copy Markdown
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request May 13, 2026
Problem:
In some cases, undo restores the selection to an incorrect position.

Cause:
The selection state was not staged before the deletion started, leading
to an inconsistent selection being restored during undo.

Solution:
Stage the selection before performing the deletion to ensure it can be
restored to the correct position.

Steps to reproduce:
- Go to To-Do → Create New.
- Type something on the first line and press Enter.
- Type something on the second line and apply styling to it.
- Use the Up arrow key to move to the first line.
- Remove a character.
- Press Undo (Ctrl + Z).
- Observe that the selection and toolbar appear on the second line.

task-6142055

closes #264167

X-original-commit: b005d8d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Walid Sahli (wasa) <wasa@odoo.com>
@robodoo robodoo added the 19.4 label May 13, 2026
@robodoo robodoo closed this May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

19.4 forwardport This PR was created by @fw-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants