bigskysoftware / bigskysoftware/_hyperscript

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

Open
#647 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.8k
Forks
172
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.