3

I'm using p-dialog from PrimNG. With [draggable] enabled, I can prevent the modal from being dragged off-screen on the left and top using [minX] and [minY].

Is there a way to prevent the modal from being dragged off-screen on the right and bottom?

I am using https://www.primefaces.org/primeng/#/dialog in a pretty standard implementation.

JonathanL
  • 136
  • 1
  • 9

2 Answers2

1

As '[minX]' is the minimum draggable coordinates to the left and '[minY]' is the minimum draggable coordinates to the top, set them to a large negative number i.e. [minX]="-1000" [minY]="-1000" . In this way you will be able to drag the dialog much more to the left and top.

Nabil Shahid
  • 1,448
  • 8
  • 11
  • I am trying to prevent the p-dialog from going off on the right and bottom I want the behavior to prevent the p-dialog from going off screen at all. – JonathanL Sep 26 '18 at 13:53
0

This commit fixed your problem: https://github.com/primefaces/primeng/commit/c47b22fe3e850ca95ab36e9d99f9bf900832a682?branch=c47b22fe3e850ca95ab36e9d99f9bf900832a682&diff=split

But as I discovered, Edge is having some trouble with it when you sroll the page and then you open the modal

Davide
  • 1,931
  • 2
  • 19
  • 39