Commit 942ee42 1 parent 3bb7041 commit 942ee42 Copy full SHA for 942ee42
File tree 3 files changed +12
-17
lines changed
superset-frontend/plugins/plugin-chart-table/src
3 files changed +12
-17
lines changed Original file line number Diff line number Diff line change 16
16
* specific language governing permissions and limitations
17
17
* under the License.
18
18
*/
19
-
20
19
import React , {
21
20
useCallback ,
22
21
useRef ,
Original file line number Diff line number Diff line change @@ -110,7 +110,6 @@ const fixedTableLayout: CSSProperties = { tableLayout: 'fixed' };
110
110
/**
111
111
* An HOC for generating sticky header and fixed-height scrollable area
112
112
*/
113
-
114
113
function StickyWrap ( {
115
114
sticky = { } ,
116
115
width : maxWidth ,
@@ -216,8 +215,7 @@ function StickyWrap({
216
215
let sizerTable : ReactElement | undefined ;
217
216
let headerTable : ReactElement | undefined ;
218
217
let footerTable : ReactElement | undefined ;
219
- let fullTable : ReactElement | undefined ;
220
-
218
+ let bodyTable : ReactElement | undefined ;
221
219
if ( needSizer ) {
222
220
const theadWithRef = React . cloneElement ( thead , { ref : theadRef } ) ;
223
221
const tfootWithRef = tfoot && React . cloneElement ( tfoot , { ref : tfootRef } ) ;
@@ -255,7 +253,6 @@ function StickyWrap({
255
253
style = { {
256
254
overflow : 'hidden' ,
257
255
} }
258
- aria-hidden = "true"
259
256
>
260
257
{ React . cloneElement (
261
258
table ,
@@ -293,18 +290,20 @@ function StickyWrap({
293
290
scrollFooterRef . current . scrollLeft = e . currentTarget . scrollLeft ;
294
291
}
295
292
} ;
296
-
297
- fullTable = (
293
+ bodyTable = (
298
294
< div
299
- key = "full-table "
295
+ key = "body "
300
296
ref = { scrollBodyRef }
297
+ style = { {
298
+ height : bodyHeight ,
299
+ overflow : 'auto' ,
300
+ } }
301
301
onScroll = { sticky . hasHorizontalScroll ? onScroll : undefined }
302
302
>
303
303
{ React . cloneElement (
304
304
table ,
305
305
mergeStyleProp ( table , fixedTableLayout ) ,
306
306
colgroup ,
307
- thead ,
308
307
tbody ,
309
308
) }
310
309
</ div >
@@ -316,11 +315,11 @@ function StickyWrap({
316
315
style = { {
317
316
width : maxWidth ,
318
317
height : sticky . realHeight || maxHeight ,
319
- overflow : 'auto' ,
320
- padding : '0' ,
318
+ overflow : 'hidden' ,
321
319
} }
322
320
>
323
- { fullTable }
321
+ { headerTable }
322
+ { bodyTable }
324
323
{ footerTable }
325
324
{ sizerTable }
326
325
</ div >
Original file line number Diff line number Diff line change @@ -32,13 +32,10 @@ export default styled.div`
32
32
td {
33
33
min-width: 4.3em;
34
34
}
35
+
35
36
thead > tr > th {
36
- position: sticky;
37
- top: -1px;
38
37
padding-right: 0;
39
- z-index: 100;
40
- border-bottom: ${ theme . gridUnit / 2 } px solid
41
- ${ theme . colors . grayscale . light2 } ;
38
+ position: relative;
42
39
background: ${ theme . colors . grayscale . light5 } ;
43
40
text-align: left;
44
41
}
You can’t perform that action at this time.
0 commit comments