New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full screen dialog in mobile mode #9823
Comments
I hadn't noticed this change, but I used to use this and it was working fine: .my-full-screen-dialog .mat-dialog-container {
max-width: none;
width: 100vw;
height: 100vh;
} Now it seems .my-full-screen-dialog {
height: 100vh;
width: 100vw !important;
max-width: none !important;
} |
It appears adding |
The solution above work good but container is not in full screen and can scrool max to 65vh. dialog options:
dialog html
now it has 100% height and width and we have a header and footer fixed and a container that scrool content. |
It'd be nice if modals could provide a full screen modal when on mobile (sm & xs) screens. |
can we get this reopened? ideally there should be fullscreen dialog support like in material ui. |
fullscreen dialog is actually in the material design spec. https://material.io/design/components/dialogs.html#full-screen-dialog can we have something like this in angular material? |
Looking for this as well. This was a feature in AngularJS material, doesn't really make sense that it's absent in angular material. Setting width/height to 100 doesn't work since we only want that to happen when the view is mobile. This worked perfectly in angularJS material. |
This is working for me, program your dialog with the cdk/layout:
import {
BreakpointObserver,
Breakpoints,
BreakpointState
} from '@angular/cdk/layout';
isExtraSmall: Observable<BreakpointState> = this.breakpointObserver.observe(
Breakpoints.XSmall
);
private readonly breakpointObserver: BreakpointObserver
const d = this.dialog.open(DialogXXXXXComponent, {
width: 'calc(100% - 50px)',
maxWidth: '100vw'
});
const smallDialogSubscription = this.isExtraSmall.subscribe(size => {
if (size.matches) {
d.updateSize('100vw', '100vh');
} else {
d.updateSize('calc(100% - 50px)', '');
}
});
d.afterClosed().subscribe(() => {
smallDialogSubscription.unsubscribe();
}); Make sure to set If size matches we update the size to fullscreen: otherwise you can set a width and leave the default height: |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
A bug to me
What is the expected behavior?
Being able to have full screen dialogs by overriding
cdk-overlay-pane
classWhat is the current behavior?
Not possible because framework adds
max-width: 80vw;
to element'sstyle
What are the steps to reproduce?
Override
cdk-overlay-pane
withwidth: 100%
and see it ignored because ofmax-width: 80vw;
in thestyle
What is the use-case or motivation for changing an existing behavior?
Displaying html blobs of site's T&C and privacy policy. May not the best way to use dialogs, but nonetheless...
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 5.2.3, Material 5.2.0
Is there anything else we should know?
I'm upgrading a site from an early 2.0.0.beta8 where this was possible.
The text was updated successfully, but these errors were encountered: