Fix: clear selection when closing current item