File tree Expand file tree Collapse file tree 3 files changed +12
-17
lines changed
superset-frontend/plugins/plugin-chart-table/src Expand file tree Collapse file tree 3 files changed +12
-17
lines changed Original file line number Diff line number Diff line change 1616 * specific language governing permissions and limitations
1717 * under the License.
1818 */
19-
2019import React , {
2120 useCallback ,
2221 useRef ,
Original file line number Diff line number Diff line change @@ -110,7 +110,6 @@ const fixedTableLayout: CSSProperties = { tableLayout: 'fixed' };
110110/**
111111 * An HOC for generating sticky header and fixed-height scrollable area
112112 */
113-
114113function StickyWrap ( {
115114 sticky = { } ,
116115 width : maxWidth ,
@@ -216,8 +215,7 @@ function StickyWrap({
216215 let sizerTable : ReactElement | undefined ;
217216 let headerTable : ReactElement | undefined ;
218217 let footerTable : ReactElement | undefined ;
219- let fullTable : ReactElement | undefined ;
220-
218+ let bodyTable : ReactElement | undefined ;
221219 if ( needSizer ) {
222220 const theadWithRef = React . cloneElement ( thead , { ref : theadRef } ) ;
223221 const tfootWithRef = tfoot && React . cloneElement ( tfoot , { ref : tfootRef } ) ;
@@ -255,7 +253,6 @@ function StickyWrap({
255253 style = { {
256254 overflow : 'hidden' ,
257255 } }
258- aria-hidden = "true"
259256 >
260257 { React . cloneElement (
261258 table ,
@@ -293,18 +290,20 @@ function StickyWrap({
293290 scrollFooterRef . current . scrollLeft = e . currentTarget . scrollLeft ;
294291 }
295292 } ;
296-
297- fullTable = (
293+ bodyTable = (
298294 < div
299- key = "full-table "
295+ key = "body "
300296 ref = { scrollBodyRef }
297+ style = { {
298+ height : bodyHeight ,
299+ overflow : 'auto' ,
300+ } }
301301 onScroll = { sticky . hasHorizontalScroll ? onScroll : undefined }
302302 >
303303 { React . cloneElement (
304304 table ,
305305 mergeStyleProp ( table , fixedTableLayout ) ,
306306 colgroup ,
307- thead ,
308307 tbody ,
309308 ) }
310309 </ div >
@@ -316,11 +315,11 @@ function StickyWrap({
316315 style = { {
317316 width : maxWidth ,
318317 height : sticky . realHeight || maxHeight ,
319- overflow : 'auto' ,
320- padding : '0' ,
318+ overflow : 'hidden' ,
321319 } }
322320 >
323- { fullTable }
321+ { headerTable }
322+ { bodyTable }
324323 { footerTable }
325324 { sizerTable }
326325 </ div >
Original file line number Diff line number Diff line change @@ -32,13 +32,10 @@ export default styled.div`
3232 td {
3333 min-width: 4.3em;
3434 }
35+
3536 thead > tr > th {
36- position: sticky;
37- top: -1px;
3837 padding-right: 0;
39- z-index: 100;
40- border-bottom: ${ theme . gridUnit / 2 } px solid
41- ${ theme . colors . grayscale . light2 } ;
38+ position: relative;
4239 background: ${ theme . colors . grayscale . light5 } ;
4340 text-align: left;
4441 }
You can’t perform that action at this time.
0 commit comments