bigskysoftware / bigskysoftware/_hyperscript
Calling show on a visible element modifies the display type to block, despite it being flex
- Vorherrschende Sprache
- JavaScript
- Sterne
- 3.8k
- Forks
- 172
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne damit, die show/hide-Implementierung zu lokalisieren und die gemeldete Sequenz mit einem Element zu reproduzieren, dessen display flex ist. Überprüfe, dass der Aufruf von show bei einem bereits sichtbaren Element dessen display-Typ unverändert lässt, während das bestehende hide-then-show-Verhalten weiterhin flex wiederherstellt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100