bigskysoftware / bigskysoftware/_hyperscript

Calling show on a visible element modifies the display type to block, despite it being flex

Aperta
#647 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
3.8k
Fork
172
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia individuando l’implementazione di show/hide e riproducendo la sequenza segnalata con un elemento il cui display sia flex. Verifica che chiamare show su un elemento già visibile lasci invariato il suo tipo di display, mentre il comportamento esistente di hide-then-show continui a ripristinare flex.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.