Skip to content

Selection highlight trails the selection: the previous highlight stays painted, and on a two-column paragraph it covers both columns #3990

Description

@Nathaniel-260

What happened?

The selection highlight trails the selection. When an existing selection is replaced by a new one, the previous highlight stays painted for a noticeable moment before the new one appears.

On a paragraph that flows across two columns this is not a cosmetic delay, because the stale highlight covers both columns. Selecting the paragraph and then dragging inside one column shows the whole paragraph — including the column the pointer is not in — lit up, and only afterwards does it shrink to the column that was actually dragged in. To a user that reads as "dragging in one column selected the other column too, and then it corrected itself".

The selection itself is never wrong. doc.selection.current() reports exactly the intended range throughout, the exported document is correct, and the end state on screen is correct. It is only the highlight that arrives late.

The same lag shows up without columns at all: after a double click or a triple click there is a stretch where nothing is highlighted before the selection paints.

Steps to reproduce

  1. New document. Layout → Columns → Two.
  2. Type or paste a single paragraph long enough to flow from the first column into the second on the same page.
  3. Triple click inside the paragraph, in the first column. The whole paragraph highlights, across both columns — this is correct, the paragraph really is in both.
  4. Now press inside the first column and drag a short distance, staying inside that column the whole time.

Observed: the both-column highlight from step 3 stays on screen; then the page goes unhighlighted; then the correct single-column highlight appears. Expected: the old highlight goes away with the new press, or the new one replaces it directly.

The bigger the document, the longer the middle state lasts. The user who reported this to us was working on a real Hebrew document — considerably larger than a synthetic fixture — and described it as roughly a second of "everything is selected".

SuperDoc version

2.13.0

Browser

Chrome

Additional context

This came out of verifying #3952. The column work there is fixed and behaves correctly in every gesture we tried, including the blank-area drag and Shift+ArrowDown across the column boundary — thank you for that. This one looks orthogonal to the column arbitration: the model is right and the paint trails it, and columns only make it conspicuous because a stale highlight can then span the gutter.

I have not established whether this predates 2.13.0, so I am deliberately not filing it as a regression. I do have timings from an instrumented run, and I am happy to send those to you privately if they would be useful.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: queuedEngineering work is queued; no delivery date is committed.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions