Skip to content

Conversation

@sbbh-odoo
Copy link
Contributor

Steps to Reproduce:

  1. Create a table in the editor (Firefox).
  2. Select table cells backward (right → left or bottom → top).

Description of the issue this PR addresses:

  • The first selected cell does not remain selected in Firefox when extending the selection backward.

task-5094832


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

@robodoo
Copy link
Contributor

robodoo commented Sep 17, 2025

Pull request status dashboard

@sbbh-odoo sbbh-odoo force-pushed the 18.0-fix-table-selection-firefox-sbbh branch 2 times, most recently from 1b81980 to 4d5aaff Compare September 18, 2025 09:47
Steps to Reproduce:

1. Create a table in the editor (Firefox).
2. Select table cells backward (right → left or bottom → top).

Before this commit:

- The first selected cell does not remain selected in Firefox when
  extending the selection backward.

After this commit:

- Backward table cell selection works consistently in Firefox.

task-5094832
@sbbh-odoo sbbh-odoo force-pushed the 18.0-fix-table-selection-firefox-sbbh branch from 4d5aaff to 4e8b1c8 Compare October 15, 2025 10:51
selection.getRangeAt(selection.rangeCount - 1).startContainer,
selection.getRangeAt(selection.rangeCount - 1).startOffset
);
if (this.selectionDirection === "backward") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use getCursorDirection here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we can’t. When a selection contains multiple ranges, it includes the entire parent <tr>, so the direction is always 'forward'. That’s why we need to store the direction from the very first selection.

@sbbh-odoo sbbh-odoo marked this pull request as ready for review October 16, 2025 07:12
@C3POdoo C3POdoo requested a review from a team October 16, 2025 07:14
@dmo-odoo
Copy link
Contributor

dmo-odoo commented Nov 5, 2025

@robodoo r+

robodoo pushed a commit that referenced this pull request Nov 5, 2025
Steps to Reproduce:

1. Create a table in the editor (Firefox).
2. Select table cells backward (right → left or bottom → top).

Before this commit:

- The first selected cell does not remain selected in Firefox when
  extending the selection backward.

After this commit:

- Backward table cell selection works consistently in Firefox.

task-5094832

closes #227694

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
@robodoo robodoo closed this Nov 5, 2025
@fw-bot fw-bot deleted the 18.0-fix-table-selection-firefox-sbbh branch November 12, 2025 15:27
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.

4 participants