File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -374,11 +374,11 @@ const ShinyDataGrid: FC<ShinyDataGridProps<unknown>> = (props) => {
374374 const headerRowCount = table . getHeaderGroups ( ) . length ;
375375
376376 // Assume we're scrolling until proven otherwise
377- let scrollingClass = "" ;
377+ let scrollingClass = rowData . length > 0 ? "scrolling" : "" ;
378378 const scrollHeight = containerRef . current ?. scrollHeight ;
379379 const clientHeight = containerRef . current ?. clientHeight ;
380- if ( scrollHeight && clientHeight && scrollHeight > clientHeight ) {
381- scrollingClass = "scrolling " ;
380+ if ( scrollHeight && clientHeight && scrollHeight <= clientHeight ) {
381+ scrollingClass = "" ;
382382 }
383383
384384 const makeHeaderKeyDown =
Original file line number Diff line number Diff line change @@ -51,9 +51,9 @@ shiny-data-frame {
5151
5252.shiny-data-grid {
5353 max-width : 100% ;
54- height : 500 px ;
55- & :not ( .scrolling ) {
56- height : auto ;
54+ height : auto ;
55+ & .scrolling {
56+ height : 500 px ;
5757 }
5858
5959 > table {
You can’t perform that action at this time.
0 commit comments