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

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

Open
baltechies opened this issue Nov 28, 2017 · 2 comments
Open

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

baltechies opened this issue Nov 28, 2017 · 2 comments

Comments

@baltechies
Copy link

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
Copy link

aleksandar-smiljanic commented May 16, 2018

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:

  • happens on SOME iOS devices iPhone (iOS 11.0.1) and iPad pro (iOS 11.2.6). It happens on Safari and Chrome.
  • other devices including all Android, desktops (Win + Mac) and other tested iOS (both older ie. 10.3.3. and newer versions 11.3.1) devices behave correctly.

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 #534 #474

.ngdialog-open {
  height: auto !important;
  overflow: inherit !important;
}

@emrecamasuvi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants