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

Improve selection.isCollapsed

Abierto
#337 4 comentarios 0 reacciones 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
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
html
Área
frontend, web-dev

Línea de trabajo

Start by reviewing the Selection API definition of selection.isCollapsed and selection.type, then reproduce the cursor-at-the-start-of-a-list case with a preceding paragraph in Chrome. Compare the reported start and end containers and determine the specification change needed. Done means the case is consistently reported as a collapsed cursor rather than a range.

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

Descripción

The selection.isCollapsed works by detecting start and end nodes and their offsets. This sometimes leads to inconsistencies because of different implementations by different browsers (especially on mobiles, tested this on chrome). Here is what happens-

  1. When a cursor is placed at the beginning of a list, the selection.isCollapsed should ideally return true and selection.type as 'cursor'.
  2. However, if there is text (say a paragraph block previously to the list), then it still gives false because startContainer is then taken as the previous text block (while end container points correctly to the list item, li of the list). So even though nothing is selected and it is just a cursor, selection.isCollapsed returns false and selection.type as 'range'.
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 Web Dev

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.