Skip to content

Tracking issue: Text input and selection #36460

Open

Description

@dklassic

This bug tracks remaining issues in text input and selection in both text inputs and in the document.

Completed

Activity

  1. added
    B-feature-tracking
    B-meta
    on Apr 11, 2025
  2. simonwuelker commented on Apr 11, 2025

    @simonwuelker
    Member

    Would it make sense to render the text inside <input> and <textarea> in a shadow tree to be able to reuse the existing selection code? We could even make non-placeholder text in input shadow trees to be contenteditable (once that attribute is implemented), which would presumably make a lot of input-specific magic go away.

    This is just a spontaneous idea i had when looking at this issue, I'm not sure if it would actually work.

  3. MichaelMcDonnell commented on Aug 29, 2025

    @MichaelMcDonnell
  4. MichaelMcDonnell commented on Aug 29, 2025

    @MichaelMcDonnell
  5. changed the title [-]Tracking issue: Text input[/-] [+]Tracking issue: Text input and selection[/+] on Aug 18, 2026
  6. added
    I-spec-unclear
    on Aug 26, 2026
  7. yezhizhen commented on Aug 26, 2026

    @yezhizhen
    Member

    The spec is unclear/outdated about shadow boundary.

    For example, it says:

    anchor and focus of selection need not to be in the document tree. It could be in a shadow tree of the same document.

    However, it also says:
    anchorNode
    The attribute must return the anchor node of this, or null if the anchor is null or anchor is not in the document tree.

    So anchorNode can never be in shadow tree. This is contradictory to tests:

    assert_equals(sel.anchorNode, inText.firstChild);

    opened w3c/selection-api#361

  8. mrobinson commented on Aug 26, 2026

    @mrobinson
    Member

    I think this is a specification oversight, because getComposedRanges() exists and is in Baseline Widely Available.

  9. yezhizhen commented on Nov 15, 2026

    @yezhizhen
    Member

    I think this is a specification oversight, because getComposedRanges() exists and is in Baseline Widely Available.

    Yeah this is under specified. Tentative tests are added w3c/selection-api#361 (comment) to investigate behaviour, and all browsers are behaving differently.

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

    A-inputB-feature-trackingB-metaI-spec-unclear

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions