Hello.
I would love to have a page where user can not scroll.
In first version of ionic i could simply add scroll="false" and it would turn off the scroll of the content.
Now to turn off the scroll i’m doing the following dirty work
I’ve checked and figured out that: scroll will be disabled if total height of the elements inside ion-content will not be more than height of scroll content.
therefore i prepared my content to be exactly the same height as scroll content using relativity
Yes i totally agree with you.
that is why i replied above
If any1 else wants to disable scroll:
I’ve checked and figured out that: scroll will be disabled if total height of the elements inside ion-content will not be more than height of scroll content.
therefore i prepared my content to be exactly the same height as scroll content using relativity
so im not doing any of that dirty work anymore, i just placed elements inside ion-content to have correct height
I have been searching on web for a week now. Can’t find any solution. I need my content to not be bouncable and scrollable. Can’t find a solution. I am happy if you share yours
There is also class disable-scroll which ionic applies to <ion-app> when you open AlertController or LoadingController.
However i’m not still sure how to use that.
Regarding to my current solution i have followings:
HTML
This is driving me nuts as well. Seems like there should be a simple way to do this. Change docs for RC0 state:
<ion-fixed> has been removed, use <div ion-fixed> instead.
I’ve tried using <div ion-fixed> with and without an enclosing container tag. While it does seem to disable scrolling, it also hoses my previously functional layout.
There is no perfect thing in this world, we should keep that all in our minds. You just need to sort out things if it doesn’t work or just change to other ways like React if Ionic doesn’t satisfy what you need.
The ‘fools’ part is expecting Ionic to jump over a feature that is easy to circumvent and is very niche.
AND it’s open source - you are absolutely free to fix it yourself - much more constructive approach.
Like - if you’re trying to stop scrolling you really shouldn’t have content going beyond the screen’s size.
I agree that the inability to have simple control of page scrolling is a curious omission. Looks like it may be rectified soon. In the meantime, I’ve been using ng2-dragula to add some basic draggable reordering to cards, and have run into the issue where page scrolling does not play nicely whilst card-dragging. This is what I’ve done to solve it for my use case. (this is not production tested)
I have a no-scroll css class that can be applied to ion-content:
Page is scrollable, except when a card is being dragged. It’s not perfect (ideally I’d like to page to scroll if the user drags an element to the top of a list that is scrolled offscreen for instance), but it’s simple and it’s working for my needs for the moment.