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

Prevent Tabs and ScrollView from unwanted cross-axis scrolling during keyboard navigation #499 #527

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/components/ScrollView/ScrollView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
//
// 7. Hide content overflowing in the other direction because scrollbars would be unreachable under
// scrolling shadows.
//
// 8. Use the `clip` value for `overflow` to prevent the content from unwanted scrolling on the
// cross axis during keyboard navigation.

@use "../../styles/tools/accessibility";
@use "../../styles/tools/caret";
Expand Down Expand Up @@ -99,7 +102,7 @@ $_arrow-outer-spacing: spacing.of(4);

.isRootVertical .viewport {
height: 100%;
overflow-x: hidden; // 7.
overflow-x: clip; // 7., 8.
overflow-y: auto; // 2.
}

Expand Down Expand Up @@ -180,12 +183,13 @@ $_arrow-outer-spacing: spacing.of(4);

.isRootHorizontal .viewport {
overflow-x: auto; // 2.
overflow-y: hidden; // 5., 7.
overflow-y: clip; // 5., 7., 8.
}

.isRootHorizontal .content {
display: inline-flex; // 4.
min-width: 100%;
overflow: clip; // 8.
vertical-align: top;
}

Expand Down
7 changes: 4 additions & 3 deletions src/components/Tabs/Tabs.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// 1. Decorative bottom border.
// 1. Use the `clip` value to prevent the content from unwanted vertical scrolling during keyboard navigation.
// 2. Decorative bottom border.

@use "../../styles/tools/reset";
@use "theme";
Expand All @@ -11,10 +12,10 @@
min-width: 100%;
padding-right: theme.$padding-x;
padding-left: theme.$padding-x;
overflow-y: hidden;
overflow-y: clip; // 1.
white-space: nowrap;

// 1.
// 2.
&::after {
content: "";
position: absolute;
Expand Down
Loading