Skip to content

Commit

Permalink
Fix focus indicator clipping in ScrollableContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaw3d committed Apr 5, 2024
1 parent 7cde53e commit d914ced
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
1 change: 1 addition & 0 deletions .changelog/1874.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix focus indicator clipping in ScrollableContainer
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,15 @@ exports[`<AccountSelector /> should match snapshot 1`] = `
box-sizing: border-box;
max-width: 100%;
margin-bottom: 48px;
margin-left: -2px;
min-width: 0;
min-height: 0;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
padding-top: 24px;
padding-bottom: 24px;
padding-left: 2px;
padding-right: 12px;
overflow-y: auto;
}
Expand Down Expand Up @@ -493,6 +495,14 @@ exports[`<AccountSelector /> should match snapshot 1`] = `
}
@media only screen and (max-width:768px) {
}
@media only screen and (max-width:768px) {
}
@media only screen and (max-width:768px) {
.c3 {
border: solid 1px #0092f6;
Expand All @@ -511,13 +521,25 @@ exports[`<AccountSelector /> should match snapshot 1`] = `
}
}
@media only screen and (max-width:768px) {
.c2 {
margin-left: -2px;
}
}
@media only screen and (max-width:768px) {
.c2 {
padding-top: 12px;
padding-bottom: 12px;
}
}
@media only screen and (max-width:768px) {
.c2 {
padding-left: 2px;
}
}
@media only screen and (max-width:768px) {
.c2 {
padding-right: 6px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,15 @@ exports[`<Contacts /> should match snapshot 1`] = `
box-sizing: border-box;
max-width: 100%;
margin-bottom: 48px;
margin-left: -2px;
min-width: 0;
min-height: 0;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
padding-top: 24px;
padding-bottom: 24px;
padding-left: 2px;
padding-right: 12px;
overflow-y: auto;
}
Expand Down Expand Up @@ -321,6 +323,14 @@ exports[`<Contacts /> should match snapshot 1`] = `
}
@media only screen and (max-width:768px) {
}
@media only screen and (max-width:768px) {
}
@media only screen and (max-width:768px) {
.c3 {
border: solid 1px #0092f6;
Expand All @@ -339,13 +349,25 @@ exports[`<Contacts /> should match snapshot 1`] = `
}
}
@media only screen and (max-width:768px) {
.c2 {
margin-left: -2px;
}
}
@media only screen and (max-width:768px) {
.c2 {
padding-top: 12px;
padding-bottom: 12px;
}
}
@media only screen and (max-width:768px) {
.c2 {
padding-left: 2px;
}
}
@media only screen and (max-width:768px) {
.c2 {
padding-right: 6px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Box } from 'grommet/es6/components/Box'
import { ResponsiveContext } from 'grommet/es6/contexts/ResponsiveContext'
import { layerScrollableAreaHeight } from '../layer'

const spaceForFocusIndicator = '2px'

interface ScrollableContainerProps {
children: ReactNode
}
Expand All @@ -13,10 +15,10 @@ export const ScrollableContainer = ({ children }: ScrollableContainerProps) => {
return (
<Box
gap="small"
pad={{ vertical: 'medium', right: 'small' }}
pad={{ vertical: 'medium', right: 'small', left: spaceForFocusIndicator }}
overflow={{ vertical: 'auto' }}
style={{ maxHeight: layerScrollableAreaHeight }}
margin={{ bottom: isMobile ? 'large' : 'none' }}
margin={{ bottom: isMobile ? 'large' : 'none', left: `-${spaceForFocusIndicator}` }}
>
{children}
</Box>
Expand Down

0 comments on commit d914ced

Please sign in to comment.