Force to open popup only inside the browser area

Please see this post: [Bug-13304]Dragging popup prevents text area input on tablet