I have an element with a flexbox
div#myFlexbox{
display:flex;
}
after hide it and show it, it gets messed up.<
I know it is a little too late (3 years) but this is the way I managed to do it.
I created a rule in css for my div, for example #myDiv, that goes like this
#myDiv[style*='block'] {
display: inline-flex !important;
}
It takes advantage of what jQuery does to the DOM, it applies 'display:block'. I used inline-flex because i needed it for what i'm doing, but it can be whatever you want. In this way the rule goes faster applied without any flickering.