likeastore / ngDialog

Modals and popups provider for Angular.js applications
http://likeastore.github.io/ngDialog
3.14k stars 692 forks source link

How to prevent page scroll up or down when close the dialog #581

Open baltechies opened 6 years ago

baltechies commented 6 years ago

Hi, I am using ng-dialog to open a form in popup. But then I close the dialog it, page scroll to the top. How I can prevent page scrolling on close ng-dialog popup? It should stay an same position from when I click on link to open a page. Can you suggest if there is any thing need to add?

aleksandar-smiljanic commented 6 years ago

Update The problem is gone after upgrading devices to iOS 11.3

The problem seems to be stemming from known webKit issue on iOS??? https://bugs.webkit.org/show_bug.cgi?id=176896


Hi, similar problem here. The same effect, but different case.

When I OPEN the dialog the underlying page scrolls to the top (so when I close the dialog the underlying page is already at the top).

ngDialog version: 1.4.0 angularjs: 1.6.10

IMPORTANT - Environment:

Relevant code snippets

    function openFullProject(event, project){
      $scope.selectedProject = project;
      // even tried preventing event propagation - doesn't help
      event.preventDefault();
      ngDialog.open({
        template: 'components/widgets/project-full/project-full-popup.html',
        className: 'ngdialog-wide',
        scope: $scope
      });
    }
    // JADE syntax
    a.card__image(href="" ng-click="SearchCtrl.openFullProject($event, project)")

I also have, as proposed in https://github.com/likeastore/ngDialog/issues/534 https://github.com/likeastore/ngDialog/issues/474

.ngdialog-open {
  height: auto !important;
  overflow: inherit !important;
}
emrecamasuvi commented 5 years ago

Thank you @aleksandar-smiljanic overflow: inherit; (without important) also worked for me :)