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

angular 1.2.* ng-include used inside ui-bootstrap - modal opening page scrolls to top #283

Open
brianmyler opened this issue Oct 9, 2015 · 0 comments

Comments

@brianmyler
Copy link

Hi, this issue only seems to occur in angular 1.2.* builds and manifests itself as follows.

If the page is longer than the viewport and I click the button that opens the modal at the bottom of the page, on modal dialog open, the page scrolls back to the top of the page.

This only occurs if I use ng-include in the modal-body of a bootstrap modal.

There are 3 plunkrs below.
The first one http://plnkr.co/edit/ppH9MqmL6FCBR9PpgjYD?p=preview uses angular 1.2.29 and has a modal without an ng-include in the modal-body and works as expected(page does not scroll to top)
The second http://plnkr.co/edit/KHyMuIQQOBzJu8ZkuCS7?p=preview uses angular 1.2.29 and has a modal with an ng-include in the modal-body (page scrolls to top)
The third one http://plnkr.co/edit/HfyctrZDJNN8Of8aYOTU?p=preview uses angular 1.4.5 and has a modal with an ng-include in the modal-body (page does not scroll to top)

I have also tried upgrading bootstraps css from 3.1.1 to 3.3.4. This makes no difference

The plunkers above are pretty basic and just there to prove the problem exists. Let me explain my use case for more context. I have an angular template that houses a set of search fields(textfields, dropdowns etc that are used in a number of pages in our application. I would also like to re-use this template in a modal dialog. To do this I include the template in the modal-body of the modal using ng-include

I would upgrade 1.3.x or above, but we currently support ie8 :-(

Any feedback welcome

@brianmyler brianmyler changed the title angular 1.* ui-bootstrap modal opening page scrolls to top angular 1.2.* ng-include used inside ui-bootstrap - modal opening page scrolls to top Oct 9, 2015
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

1 participant