Use requestAnimationFrame to prevent hing pop-over from flickering.

Fixes #1852.