Improve hiding/showing to persist component focus when needed