-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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 disable scroll for ion-content in ionic 2? #7644
Comments
i dont want to hijack my browser,any other option by ionic team? |
Hello! Thanks for using Ionic! We actually just documented a method called |
Hi,any example how can i use it? |
Hi @rhuldip . As I understood on another page, you wanted to disable the scroll for and not for the whole app. In this case you can use :
and then, in your SCSS file :
credits to @mhartington for the guidance |
Is there a directive for this? The documentation mentions it but it does not work. |
Below I show how this can also be solved: Create thoses classes in some of zour scss files, i.e app.scss
Then just call:
or
Where content is:
Hope this helps |
Thanks @dgroh , it works really well on my end as of |
I used the following SO answer to fix it http://stackoverflow.com/a/40826366/1783311 Add this to your .scss file
then add the no-scroll class to your ion-content like this
|
I solved it as below.
|
@jgw96 This does not work after RC4. Should we reopen this? |
@jgw96 please consider adding this functionality, its much needed. |
@iflagri solution works. Thanks ! |
If anyone is still having trouble with this, add
|
@larssn fix it. Thanks ! |
@larssn Fix it. ty! |
If you don't want the scroll you may also don't need the ion-content itself, in my status for example I want to use the ion-grid directly.
and I added some scss for the has-header class:
|
Need to support disabling scrolling through an attribute on |
I have an issue on iOS, where if I have a select doing a scrolling gesture on it scrolls the contents underneath, so I want to disable the scroll when the select is up. None of the above seems to work for me. I've tried the |
In my case, I had to set this scroll in code, as it is the nested div with the class To do this in code, I did the following...
|
@pjc2007, you made my day |
@iflagri thank you so much! I was struggling for a few days now, the solution which worked for me was:
|
The only solution which works for me. Thanks @KeaganFouche |
The only working solution for me is @iflagri one. I'm wondering why a div is needed, I tried to put
|
Adding this in config.xml works or me.
|
I don't know why exactly you want to remove it, but if because of the fixed height of the
and all my
|
Here's how I handled it, which seems like the more natural approach to me. Just open your src/app/app.scss (Where your global styles should live) and add... I don't know why you would want to force scroll or hidden, when your style should be dynamic to the content in most cases. If you have a special case, go ahead and hard code it, but in general, I don't understand why Ionic has this overridden to scroll. |
Every single page has a scrollbar by default that only scrolls at most a couple pixels. This should be considered a bug. The |
Thanks for the issue! We have moved the source code and issues for Ionic 3 into a separate repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there. Thank you for using Ionic! |
This issue has been automatically identified as an Ionic 3 issue. We recently moved Ionic 3 to its own repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there. If I've made a mistake, and if this issue is still relevant to Ionic 4, please let the Ionic Framework team know! Thank you for using Ionic! |
Issue moved to: ionic-team/ionic-v3#123 |
Note: If you are having problems formatting your issue please refer to this article on using markdown in Github:
https://guides.github.com/features/mastering-markdown/
Note: for support questions, please use one of these channels:
https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/
Short description of the problem:
What behavior are you expecting?
Steps to reproduce:
1.
2.
3.
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
Which Ionic Version? 1.x or 2.x
Plunker that shows an example of your issue
For Ionic 1 issues - http://plnkr.co/edit/Xo1QyAUx35ny1Xf9ODHx?p=preview
For Ionic 2 issues - http://plnkr.co/edit/me3Uk0GKWVRhZWU0usad?p=preview
Run
ionic info
from terminal/cmd prompt: (paste output below)The text was updated successfully, but these errors were encountered: