Skip to content

Conversation

@e11sy
Copy link
Contributor

@e11sy e11sy commented Apr 9, 2025

Changes

  • now if selection from selectionchange event differs with dom selection, we change dom selection with
selection.removeAllRanges();  // <---- this triggers `selectionchange` event with empty bounds and selection collapses 
selection.addRange(range);

Why only in r2l selections?

to compare dom selection with model one, we use getBoundaryPointByAbsoluteOffset() that returns right bound of the left node, however selection expects left bound of the right column:

... | \tag ... !== ... \tag | ...
and selection updates with selection.removeAllRanges() causing an issue

@github-actions
Copy link

github-actions bot commented Apr 9, 2025

⏭️ No files to mutate for ./packages/model

@github-actions
Copy link

github-actions bot commented Apr 9, 2025

Coverage report for ./packages/dom-adapters

St.
Category Percentage Covered / Total
🟢 Statements 100% 0/0
🟢 Branches 100% 0/0
🟢 Functions 100% 0/0
🟢 Lines 100% 0/0

Test suite run success

1 tests passing in 1 suite.

Report generated by 🧪jest coverage report action from 36d2dd9

@github-actions
Copy link

github-actions bot commented Apr 9, 2025

Coverage report for ./packages/model

St.
Category Percentage Covered / Total
🟢 Statements 95.98% 835/870
🟢 Branches 96% 216/225
🟢 Functions 87.67% 199/227
🟢 Lines 95.83% 805/840

Test suite run success

411 tests passing in 25 suites.

Report generated by 🧪jest coverage report action from 36d2dd9

@github-actions
Copy link

github-actions bot commented Apr 9, 2025

⏭️ No files to mutate for ./packages/dom-adapters

@github-actions
Copy link

github-actions bot commented Apr 9, 2025

Coverage report for ./packages/collaboration-manager

St.
Category Percentage Covered / Total
🟢 Statements 98.03% 149/152
🟢 Branches 91.8% 56/61
🟢 Functions 94.74% 18/19
🟢 Lines 98% 147/150

Test suite run success

67 tests passing in 4 suites.

Report generated by 🧪jest coverage report action from 36d2dd9

@e11sy e11sy added this pull request to the merge queue Apr 9, 2025
Merged via the queue into main with commit 01c883b Apr 9, 2025
15 checks passed
@e11sy e11sy deleted the fix-selection-collapse-r2l branch April 9, 2025 01:42
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