Add autoClose option to Popup

Fixes #2716
Fixes #1853