Hotkeys are fired when trying to type into a text field inside a custom element
- Lenguaje dominante
- JavaScript
- Estrellas
- 3.3k
- Forks
- 99
- Merge medio
- 14 h 22 min
- PR fusionados (30 d)
- 6
Descripción
When typing in an input (textarea, input tag, editable, …) which is itself placed inside of a custom html element, the hotkey is still fired. That's because the [isFormField](https://github.com/github/hotkey/blob/main/src/utils.ts#L4) handler checks only the target element, which is this case is the custom element. It should instead use the `explicitOriginalTarget` property, since that contains the actual input element.
Here's a minimal reproduction: https://jsfiddle.net/zm7etdh3/
Guía de contribución
Línea de trabajo
Comienza en src/utils.ts, en el handler isFormField, y compara el manejo actual del destino con la propiedad explicitOriginalTarget descrita en el issue. Usa la reproducción mínima enlazada de JSFiddle para verificar que escribir en un input, textarea o elemento editable dentro de un elemento HTML personalizado ya no activa el hotkey.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript
- Área
- frontend
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 52/100