fixes selected state disappearing when clicking an active tab