Fix flickering popover animations

Closes #4138

- Removed JS animation to close in favour of CSS animations
@novaugust It does not depend only on isOpen.

It is fade-in when isOpen is set to true, it is fade-out when closing is set to true (while isOpen is still true) and will remain fade-out when closing and isOpen is set to false.