bug(DIALOG): draggable and resizeable mat-dialog in Angular 16
Description
I am using Angular version 16 along with Angular Material version 16. In my application, I have implemented a dialog component along with both dragging and resizing functionality. While I have successfully enabled dragging within the screen (viewport) and resizing functionality, I am facing an issue when the dialog is dragged to the top-left corner. In this scenario, resizing the dialog causes it to move outside the viewport, which is not the expected behavior. Expected Behavior: When the dialog is dragged to the top-left corner, resizing should not cause it to move outside the visible area of the screen. Instead, it should resize towards the bottom and right directions while remaining fully within the viewport.
This is the Angular 8 referance https://stackoverflow.com/questions/58606128/draggable-and-resizeable-mat-dialog-in-angular-8
Here is angular 16 https://angular-lhvwndmb.stackblitz.io
Reproduction
StackBlitz link: https://angular-lhvwndmb.stackblitz.io https://stackblitz.com/edit/angular-jszctmpc?file=package.json (angular 8)
Steps to reproduce:
- Open the dialog.
- Resize the dialog to its minimum height and width.
- Drag the dialog to the top-left corner of the screen.
- Attempt to resize the dialog to its maximum height and width.
- Notice that the dialog moves out of the visible area. Since dragging is only enabled via the header/title bar, and that portion goes off-screen, it becomes impossible to drag the dialog back down.
Expected Behavior
Expected Behavior: When the dialog is dragged to the top-left corner, resizing should not cause it to move outside the visible area of the screen. Instead, it should resize towards the bottom and right directions while remaining fully within the viewport.
Actual Behavior
Actual Behavior: When the dialog is dragged to the top-left corner, resizing dialog move outside the visible area of the screen.
Environment
- Angular: 16.2.6
- CDK/Material:16.2.5
- Browser(s): chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macos, windows
There's an example of a draggable dialog here: https://material.angular.dev/cdk/drag-drop/overview#alternate-drag-root-element. We don't have the ability to make it resizable yet.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.