Implement screen boundary detection for the depicted widgets and adjust the popup position to be completely shown in the visible area of the browser.
Actually this feature is supported automatically by the depicted widgets. Apologies for any confusion caused.