Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Pass the original events or add events types in selectionchange

Abierto
#65 2 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
html
Área
api, web-dev

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

NewAPI

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/

Lenguaje dominante
HTML
Estrellas
49
Forks
30
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de w3c/selection-api

Todos los issues de w3c/selection-api

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.