Pass the original events or add events types in selectionchange
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with the selectionchange callback described in the issue and use the linked JSFiddle to understand the requested behavior. Compare the two proposed approaches—passing the original keyboard or mouse event, or adding event type information—and determine which event shape and triggering cases should be specified. Done means the API behavior and callback event semantics are clearly defined.
Written by the indexing model from the issue text.
Description
selectionchange is really useful, it would be even better if the event parameter of the callback could say more about what triggered the selection change, either passing a MouseEvent, a KeyEvent etc.. or giving a type property to the event
document.addEventListener('selectionchange', e=>{
if (e instanceof KeyEvent) console.log(e.keyCode) // very useful if I want to act on undo/redo..
else if (e instanceof MouseEvent) console.log(e.target)// e.target is not really needed
// since I can use the current Range to know in what elements the selection is
// ...
});
the idea is to have something like that http://jsfiddle.net/crl/rk6f74tw/12/
- Dominant language
- HTML
- Stars
- 49
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from w3c/selection-api
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
w3c/selection-api#354 ·
-
Agenda+
Difficulty 3/5 1-2 days Newbie friendliness 48/100
w3c/selection-api#361 · 2 comments ·
-
w3c/selection-api#358 · 2 comments · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
w3c/selection-api#355 ·
-
the steps of Selection.extend() does not check whether the given offset is valid in the container Open
Difficulty 1/5 Under an hour Newbie friendliness 55/100
w3c/selection-api#353 · 1 comment ·
All issues in w3c/selection-api
Similar issues
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100