fix CSS when pressing Dialog close icon, fixes #17501
(cherry picked from commit c1bc942b5002a54f8af83c7449c9f86e83a4d9fa)