Skip to content

Improve interaction of badge column and editable text selection#2420

Merged
tf merged 3 commits into
codevise:masterfrom
tf:thread-text-sel-rect
May 12, 2026
Merged

Improve interaction of badge column and editable text selection#2420
tf merged 3 commits into
codevise:masterfrom
tf:thread-text-sel-rect

Conversation

@tf
Copy link
Copy Markdown
Member

@tf tf commented May 12, 2026

REDMINE-21261

tf added 3 commits May 12, 2026 14:04
Collapse editor.selection to the start of the clicked thread on
badge click so that downstream consumers (commentThreadIdsAtSelection
in transient state, the comments-mode switch-out check) see the
cursor's block as the thread's block.

Slate-react only mirrors editor.selection to the DOM while the editor
is focused, but the badge lives in a floating portal, so the click
moves focus to the badge button and the sync is skipped — the user's
prior text selection stays visibly painted even though slate's state
is correctly collapsed. We do not clear the DOM selection ourselves
either: a removeAllRanges call fires a selectionchange that slate-
react's listener uses to overwrite editor.selection back to null,
which would undo this transform and drop the selection rect. The
visible text selection therefore lingers until the user's next
interaction with the editor; that's an acceptable trade since the
slate state stays correct for everything downstream.
@tf tf added this to the v17.2 milestone May 12, 2026
@tf tf changed the title Thread text sel rect Improve interaction of badge column and editable text selection May 12, 2026
@tf tf merged commit c3c8d67 into codevise:master May 12, 2026
18 checks passed
@tf tf deleted the thread-text-sel-rect branch May 12, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant