core: Prevent page reload when clicking on close button