Skip to content
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

modal dialogs should prevent the background from being scrolleable #1625

Closed
gatapia opened this issue Dec 20, 2016 · 10 comments
Closed

modal dialogs should prevent the background from being scrolleable #1625

gatapia opened this issue Dec 20, 2016 · 10 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@gatapia
Copy link
Contributor

gatapia commented Dec 20, 2016

Using Ultima theme.

If we have a modal dialog then the background should not be scrollable when the dialog is visible.

If you could just add a 'modal-dialog-visible' class to the body this would sort the issue out.

@staran
Copy link

staran commented Jan 4, 2017

+1, additionally the background text should not be selectable when being in the process of selecting text in the dialog and leaving its borders

@iischwuerfl
Copy link

+1

@hparfen
Copy link

hparfen commented Mar 21, 2017

+1

@cagataycivici cagataycivici self-assigned this Jun 19, 2017
@cagataycivici cagataycivici added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Jun 19, 2017
@cagataycivici cagataycivici added this to the 4.1.0 milestone Jun 19, 2017
@dhniels
Copy link

dhniels commented Jul 28, 2017

Did this get added in 4.1.0? I still get the page scrolling in the background when scrolling the dialog with modal set to true.

@pchriste24
Copy link

To add to this issue, with modal=true you can Tab over inputs in the background and then edit their values.

@brettkc
Copy link

brettkc commented Nov 7, 2017

As others have stated there still seems to be issues with this. I've got a dropdown in my modal dialog and the page in the background is still scrollable and completely messes up the rendering of the dropdown if you scroll outside of the modal.

@TheAvalanche
Copy link

This feature is undocumented for some reason. But you can block body from scrolling by adding [blockScroll]=true to your p-dialog component.

For example:

<p-dialog header="Title" [(visible)]="showDetailsModal" [modal]="true" [draggable]="false" [positionLeft]="0" [positionTop]="0" [blockScroll]="true">
...
</p-dialog>

@ravikumarpamarthi
Copy link

Thanks @TheAvalanche

@dhniels
Copy link

dhniels commented Mar 22, 2018

Using [blockScroll]="true" is anyone else having an issue where it still scrolls the body on touch devices? testing on my iphone, scrolling the dialog content scrolls the body content behind the dialog. on desktop it works fine and blocks scrolling.

@pedrotcm
Copy link

In IOS devices still scrolls the body, same using [blockScroll]="true" and [modal]="true".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests