Skip to content

Commit 105796f

Browse files
authored
fix(segment-view): prevent vertical scroll while scrolling horizontally (#30276)
Issue number: resolves #30001 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> When segment view has content that is long enough to render outside of the viewport, then a user can scroll vertically and horizontally when the user scrolled down to see the content at the bottom. This causes disorientation as scrolling should only be in one direction. This only happens on a mobile device, specifically Android. It can be reproduce with a browser simulator. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Updated styling to take into account that content might be outside of the viewport. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Dev build: `8.5.2-dev.11743531350.19e040aa`
1 parent 7f9df7a commit 105796f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎core/src/components/segment-content/segment-content.scss

+13
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,17 @@
88
flex-shrink: 0;
99

1010
width: 100%;
11+
12+
overflow-y: scroll;
13+
14+
/* Hide scrollbar in Firefox */
15+
scrollbar-width: none;
16+
17+
/* Hide scrollbar in IE and Edge */
18+
-ms-overflow-style: none;
19+
20+
/* Hide scrollbar in webkit */
21+
&::-webkit-scrollbar {
22+
display: none;
23+
}
1124
}

0 commit comments

Comments
 (0)