bigskysoftware / bigskysoftware/_hyperscript
Calling show on a visible element modifies the display type to block, despite it being flex
- Lenguaje dominante
- JavaScript
- Estrellas
- 3.8k
- Forks
- 171
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
I encountered some unwanted behavior when using show/hide to filter a list of elements specifying _display:flex_.
When calling the correct sequence everything works OK. So calling _hide_ first seems to register the original display type before setting _display:none_. Then after calling _show_, _display:flex_ is restored.
Calling _show_ on an element that is already visible causes the display type to change to _block_. And it never reverts to _flex_ in my case. This causes undesired changes to the layout. Ideally this method should have no effect in this case.
I've worked around this to make sure _show_ is never called on visible elements, but I think this should be default behavior.
PS. The docs state that show/hide switches between none and block. But this is obviously not the case since it also switches to flex.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza localizando la implementación de show/hide y reproduciendo la secuencia reportada con un elemento cuyo display sea flex. Verifica que llamar a show sobre un elemento que ya es visible deje sin cambios su tipo de display, mientras que el comportamiento existente de hide-then-show siga restaurando flex.
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
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100