Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Commit

Permalink
fix(Table): 💄 Make horizontal scrolling work on iOS devices
Browse files Browse the repository at this point in the history
* Change breakpoint from sm to md
* Change overflow to scroll instead of auto on small screens
* Add -webkit-overflow-scrolling: touch to make scrolling smoother on
iOS
  • Loading branch information
Andreas Broström committed Jun 5, 2017
1 parent 9d1006e commit ba6981d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
7 changes: 6 additions & 1 deletion src/components/table/table-styles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ export default createStyleSheet('Table', theme => {
return {
root: {
width: '100%',
overflow: 'auto',
overflow: 'scroll',
'-webkit-overflow-scrolling': 'touch',
position: 'relative',

[theme.mixins.media('md')]: {
overflow: 'auto',
},
},
table: {
...mixins.basicBoxSizing,
Expand Down
6 changes: 4 additions & 2 deletions src/components/tbody/tbody-styles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ export default createStyleSheet('Tbody', theme => {
...styleUtils.borders(palette),
width: '100%',
maxHeight: '70vh',
overflowY: 'auto',
overflow: 'scroll',
'-webkit-overflow-scrolling': 'touch',

[mixins.media('sm')]: {
[mixins.media('md')]: {
overflow: 'auto',
maxHeight: '100%',
},

Expand Down
2 changes: 1 addition & 1 deletion src/components/td/td-styles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default createStyleSheet('Td', theme => {
paddingTop: 8,
paddingBottom: 8,

[mixins.media('sm')]: {
[mixins.media('md')]: {
fontSize: 14,
minWidth: 40,
paddingTop: 20,
Expand Down
2 changes: 1 addition & 1 deletion src/components/th/th-styles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default createStyleSheet('Th', theme => {
minWidth: 20,
paddingBottom: 4,

[mixins.media('sm')]: {
[mixins.media('md')]: {
minWidth: 40,
paddingBottom: 10,
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/thead/thead-styles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default createStyleSheet('Thead', theme => {
fontSize: 12,
paddingBottom: 4,

[mixins.media('sm')]: {
[mixins.media('md')]: {
paddingBottom: 10,
},

Expand Down
2 changes: 1 addition & 1 deletion src/components/tr/tr-styles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default createStyleSheet('Tr', theme => {
background: palette.background.default,
},

[mixins.media('sm')]: {
[mixins.media('md')]: {
'&.sticky': {
position: 'fixed',
},
Expand Down

0 comments on commit ba6981d

Please sign in to comment.