ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: ion-content has always a vertical scroller

Open mpaland opened this issue 10 years ago • 13 comments

Type: bug

Ionic Version: 2.x beta.3

Platform: all

<ion-content> always contains <scroll-content> which has

scroll-content {
  overflow-y: scroll;
}

so the vertical scrollbar is always visible in ion-content.

Suggesttion:

  • Should be better to set overflow-y to 'auto'
  • Scrollbars of <ion-content> should be configurable as in ionic1

mpaland avatar Apr 02 '16 13:04 mpaland

+1, is there a reason for it being 'scroll' instead of 'auto'?

ghost avatar Apr 04 '16 03:04 ghost

hi @mpaland I have the same problem I see vertical scroll in all my screens, do you have a work around?

cesar-oyarzun-m avatar Apr 07 '16 15:04 cesar-oyarzun-m

@cesar-oyarzun-m As a workaround you could add the following in the application's app.core.scss:

scroll-content {
    overflow-y: auto !important;
}

iignatov avatar Apr 08 '16 13:04 iignatov

yeah I did that thanks!!

cesar-oyarzun-m avatar Apr 08 '16 13:04 cesar-oyarzun-m

@iignatov what about just set overflow-y: hidden;

What potential problem can that cause?

GitGump avatar May 12 '16 06:05 GitGump

@GitGump I haven't tried it, but I guess that the content will be clipped, i.e. when the content is higher than the screen the overflowing part won't be displayed - does this sound like a problem? :wink:

iignatov avatar May 13 '16 16:05 iignatov

@iignatov Hey, buddy, that's the thing, I've tried it on emulators, turned out that the overflowing part wouldn't be displayed just like you said and the screen couldn't scroll either.

GitGump avatar May 16 '16 01:05 GitGump

You can override the CSS to use auto if you wish, but you look momentum scrolling on devices: https://css-tricks.com/snippets/css/momentum-scrolling-on-ios-overflow-elements/

adamdbradley avatar Jun 23 '16 16:06 adamdbradley

@adamdbradley What about a platform specific configuration in this case:

.content .scroll-content {
    overflow-y: auto;
}
.content-ios .scroll-content {
    overflow-y: scroll;
}

So set always to scroll only for ios platform, because as far I can see it's only ios relevant.

palsch avatar Feb 13 '17 14:02 palsch

I just create a pull request #10431 to set the overflow-y to auto only on desktop platform device.

5im0n avatar Feb 15 '17 18:02 5im0n

The bug is still affecting update 3.18.0. Was not it corrected?

nemexyz avatar Nov 19 '17 02:11 nemexyz

imp i want to implement this type of scrool bar in my ionic app ho to do it

Tulika12 avatar Jan 24 '18 07:01 Tulika12

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 01 '18 10:09 ionitron-bot[bot]