Skip to content

Commit de5357b

Browse files
committed
Fix stripedColor and highlightColor theming not working with sticky columns
1 parent 3cd3c04 commit de5357b

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
## Minor improvements and bug fixes
3636

3737
* Fixed `JS()` not working when `htmlwidgets` 1.6.3 or later is installed. ([#348](https://github.com/glin/reactable/issues/348))
38+
* In `reactableTheme()`, `stripedColor` and `highlightColor` now work when using sticky columns. (@grcatlin, [#401](https://github.com/glin/reactable/issues/401))
3839

3940
## Breaking changes
4041

srcjs/__tests__/theme.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,18 @@ describe('createTheme', () => {
110110
backgroundColor: 'stripedColor',
111111
rowStripedStyle: 'rowStripedStyle'
112112
},
113+
'&.rt-tr-striped-sticky': {
114+
backgroundColor: 'stripedColor',
115+
rowStripedStyle: 'rowStripedStyle'
116+
},
113117
'&.rt-tr-highlight:hover': {
114118
backgroundColor: 'highlightColor',
115119
rowHighlightStyle: 'rowHighlightStyle'
116120
},
121+
'&.rt-tr-highlight-sticky:hover': {
122+
backgroundColor: 'highlightColor',
123+
rowHighlightStyle: 'rowHighlightStyle'
124+
},
117125
'&.rt-tr-selected': {
118126
rowSelectedStyle: 'rowSelectedStyle'
119127
}

srcjs/theme.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,18 @@ export function createTheme(options) {
115115
backgroundColor: stripedColor,
116116
...rowStripedStyle
117117
},
118+
'&.rt-tr-striped-sticky': {
119+
backgroundColor: stripedColor,
120+
...rowStripedStyle
121+
},
118122
'&.rt-tr-highlight:hover': {
119123
backgroundColor: highlightColor,
120124
...rowHighlightStyle
121125
},
126+
'&.rt-tr-highlight-sticky:hover': {
127+
backgroundColor: highlightColor,
128+
...rowHighlightStyle
129+
},
122130
'&.rt-tr-selected': {
123131
...rowSelectedStyle
124132
}

0 commit comments

Comments
 (0)