Attach active pane item view before showing/hiding

Fixes #4112