Panel: Retain current page during closing process

Fixes gh-7814