I am currently working on an Angular project. I use the MatDialog from Angular material together with the Angular module of drag and drop. I want to prevent the dialog from being dragged outside of the screen window. Does anyone know how to do this?
Thanks in advance.
You can set cdkDragBoundary
to .cdk-overlay-container
which has the size of the screen.
Stackblitz
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With