Having a matching `selectend` event?

Open
#146 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
html
Domain
api

Research direction

No files or tests are named. Start by reading the Selection API material around selectstart, selectionchange, and getSelection, then review the issue discussion for existing rationale. Done means reaching and documenting a clear decision on whether selectend belongs in the API and what its firing semantics should be.

Written by the indexing model from the issue text.

Description

NewAPI

A naive question, and there's probably a good reason why there isn't one already, but: would it make sense to also have a matching selectend event that fires once the user is done selecting something? Unless I'm misunderstanding, otherwise the process at the moment to work with the API is:

  • wait for selectstart
  • keep listening out for selectionchange events (which will keep firing as long as the user is still in the process of making the selection)
  • have some kind of timer/debounce on the change listener, to try and work out when the user is done with selecting things (and/or listen out for mouseup, touchend, pointerup, etc to try and guess when the user finished), and then get the selected text with .getSelection()
Dominant language
HTML
Stars
49
Forks
30
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from w3c/selection-api

All issues in w3c/selection-api

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.