Skip to content

Rendered soft-hyphen glyph is excluded from selection highlight (skparagraph getRectsForRange skips hyphens) #189234

Closed

Description

@dbebawy

Follow-up from #185152 (soft-hyphen rendering, part of #18443).

When Hyphens.manual renders a hyphen glyph at a soft-hyphen line break, the glyph participates in the line's width and in coordinate hit-testing, but skparagraph's getRectsForRange deliberately skips the synthetic hyphen run:

https://github.com/google/skia/blob/6d145bc3479ceda0239fb955981f67f484d5e4dd/modules/skparagraph/src/TextLine.cpp#L1237-L1243

So when a selection spans a soft-hyphen break, the visible hyphen is not included in the selection highlight, which can look surprising (the surrounding text is highlighted but the hyphen appears unselected).

The fix lives in skparagraph (include the hyphen run in getRectsForRange when renderSoftHyphens is enabled), so tracking it separately per the discussion on #185152 with @LongCatIsLooong and @Renzo-Olivares.

Activity

  1. added
    a: text inputEntering text in a text field or keyboard related problems
    frameworkflutter/packages/flutter repository. See also f: labels.
    a: typographyText rendering, possibly libtxt
    f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIs
    on Jul 10, 2026
  2. added
    platform-webWeb applications specifically
    team-webOwned by Web platform team
    and removed on Jul 10, 2026
  3. added
    P3Issues that are less important to the Flutter project
    triaged-webTriaged by Web platform team
    on Jul 15, 2026
  4. Renzo-Olivares commented on Aug 20, 2026

    @Renzo-Olivares
    Contributor

    @flutter-zl bringing this issue to team-text-input since it is not web specific.

  5. 5 remaining items

  6. flutter-triage-bot commented on Aug 20, 2026

    @flutter-triage-bot

    The triaged-web label is irrelevant if there is no team-web label or fyi-web label.

  7. dbebawy commented on Oct 22, 2026

    @dbebawy
    ContributorAuthor

    Fixed in Skia by https://skia-review.googlesource.com/c/skia/+/1396916, which rolled into Flutter in #194828. The Skia change includes tests for the selection boxes, including custom hyphen strings.

  8. github-actions commented on Nov 5, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  9. locked as resolved and limited conversation to collaborators on Nov 5, 2026
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

    P3Issues that are less important to the Flutter projecta: text inputEntering text in a text field or keyboard related problemsa: typographyText rendering, possibly libtxtf: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsframeworkflutter/packages/flutter repository. See also f: labels.platform-webWeb applications specificallyteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions