Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

feat: Implement mouse text selection support #294

@dklassic

Description

@dklassic

Currently text selection only works with keypress and implementing mouse text selection support would be a great improvement. This feature will have to be added in through Servo, some upstream issues are currently tracking part of our requirement:

Meanwhile Servo already had both edit point and text selection functionality implemented in htmlinputelement and htmltextareaelement respectively, what's left to do is to actually display it in a visible manner. Additionally mouse selection on htmlinputelement has already been implemented albeit currently the layout engine simply does not respond to query.

Expected Behavior:

Users should be able to click on text, see a caret at where they've clicked on, and see the text being selected by dragging a mouse click.

Acceptance Criteria:

  • The text input interface should show a caret at where the edit point is at
  • The text input interface should show where the range of text selected
  • When clicking on text inside a text input, the edit point should be updated to the closest location within the text from where the mouse click happened

Good to Haves:

  • Currently the mouse selection implementation is only done for the htmlinputelement but would be nice to have it extended to htmltextareaelement as well

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions