@@ -326,117 +326,133 @@ export function Grid<T>({
326326 { scrollableItems }
327327 </ ScrollDiv >
328328 { /* Mid Left */ }
329- < div style = { { position : "sticky" , left : 0 , width : adjustedWidth } } >
330- < ScrollDiv
331- disableSticky = { disableSticky }
332- topOffset = { topOffset }
333- leftOffset = { 0 }
334- top = { totalTopHeight }
335- left = { 0 }
336- >
337- { midLeftItems }
338- </ ScrollDiv >
339- </ div >
340-
329+ { ! ! pinnedLeftCount && (
330+ < div style = { { position : "sticky" , left : 0 , width : adjustedWidth } } >
331+ < ScrollDiv
332+ disableSticky = { disableSticky }
333+ topOffset = { topOffset }
334+ leftOffset = { 0 }
335+ top = { totalTopHeight }
336+ left = { 0 }
337+ >
338+ { midLeftItems }
339+ </ ScrollDiv >
340+ </ div >
341+ ) }
341342 { /* Mid Right */ }
342- < div style = { { position : "sticky" , left : 0 , width : adjustedWidth } } >
343- < ScrollDiv
344- disableSticky = { disableSticky }
345- topOffset = { topOffset }
346- leftOffset = { 0 }
347- top = { totalTopHeight }
348- left = { adjustedWidth - totalRightWidth }
349- >
350- { midRightItems }
351- </ ScrollDiv >
352- </ div >
343+ { ! ! pinnedRightCount && (
344+ < div style = { { position : "sticky" , left : 0 , width : adjustedWidth } } >
345+ < ScrollDiv
346+ disableSticky = { disableSticky }
347+ topOffset = { topOffset }
348+ leftOffset = { 0 }
349+ top = { totalTopHeight }
350+ left = { adjustedWidth - totalRightWidth }
351+ >
352+ { midRightItems }
353+ </ ScrollDiv >
354+ </ div >
355+ ) }
353356
354357 { /* Top Mid */ }
355- < div
356- style = { {
357- position : "sticky" ,
358- top : 0 ,
359- left : 0 ,
360- } }
361- >
362- < ScrollDiv
363- disableSticky = { disableSticky }
364- topOffset = { 0 }
365- leftOffset = { leftOffset }
366- top = { 0 }
367- left = { totalLeftWidth }
358+ { ! ! pinnedTopCount && (
359+ < div
360+ style = { {
361+ position : "sticky" ,
362+ top : 0 ,
363+ left : 0 ,
364+ } }
368365 >
369- { topMidItems }
370- </ ScrollDiv >
371- </ div >
366+ < ScrollDiv
367+ disableSticky = { disableSticky }
368+ topOffset = { 0 }
369+ leftOffset = { leftOffset }
370+ top = { 0 }
371+ left = { totalLeftWidth }
372+ >
373+ { topMidItems }
374+ </ ScrollDiv >
375+ </ div >
376+ ) }
372377 { /* Top Left */ }
373- < div style = { { position : "sticky" , top : 0 , left : 0 , width : adjustedWidth } } >
374- < ScrollDiv disableSticky = { false } top = { 0 } left = { 0 } topOffset = { 0 } leftOffset = { 0 } >
375- { topLeftItems }
376- </ ScrollDiv >
377- </ div >
378+ { ! ! pinnedTopCount && ! ! pinnedLeftCount && (
379+ < div style = { { position : "sticky" , top : 0 , left : 0 , width : adjustedWidth } } >
380+ < ScrollDiv disableSticky = { false } top = { 0 } left = { 0 } topOffset = { 0 } leftOffset = { 0 } >
381+ { topLeftItems }
382+ </ ScrollDiv >
383+ </ div >
384+ ) }
378385 { /* Top Right */ }
379- < div style = { { position : "sticky" , top : 0 , left : 0 , width : adjustedWidth } } >
380- < ScrollDiv
381- disableSticky = { false }
382- top = { 0 }
383- left = { adjustedWidth - totalRightWidth }
384- topOffset = { 0 }
385- leftOffset = { 0 }
386- >
387- { topRightItems }
388- </ ScrollDiv >
389- </ div >
386+ { ! ! pinnedTopCount && ! ! pinnedRightCount && (
387+ < div style = { { position : "sticky" , top : 0 , left : 0 , width : adjustedWidth } } >
388+ < ScrollDiv
389+ disableSticky = { false }
390+ top = { 0 }
391+ left = { adjustedWidth - totalRightWidth }
392+ topOffset = { 0 }
393+ leftOffset = { 0 }
394+ >
395+ { topRightItems }
396+ </ ScrollDiv >
397+ </ div >
398+ ) }
390399
391400 { /* Bot Mid */ }
392- < div style = { { position : "sticky" , top : adjustedHeight - totalBotHeight , left : 0 } } >
393- < ScrollDiv
394- disableSticky = { disableSticky }
395- leftOffset = { leftOffset }
396- topOffset = { 0 }
397- top = { 0 }
398- left = { totalLeftWidth }
399- >
400- { botMidItems }
401- </ ScrollDiv >
402- </ div >
401+ { ! ! pinnedBottomCount && (
402+ < div style = { { position : "sticky" , top : adjustedHeight - totalBotHeight , left : 0 } } >
403+ < ScrollDiv
404+ disableSticky = { disableSticky }
405+ leftOffset = { leftOffset }
406+ topOffset = { 0 }
407+ top = { 0 }
408+ left = { totalLeftWidth }
409+ >
410+ { botMidItems }
411+ </ ScrollDiv >
412+ </ div >
413+ ) }
403414 { /* Bot Left */ }
404- < div
405- style = { {
406- position : "sticky" ,
407- top : adjustedHeight - totalBotHeight ,
408- left : 0 ,
409- width : adjustedWidth ,
410- } }
411- >
412- < ScrollDiv
413- disableSticky = { disableSticky }
414- leftOffset = { 0 }
415- topOffset = { 0 }
416- top = { 0 }
417- left = { 0 }
415+ { ! ! pinnedBottomCount && ! ! pinnedLeftCount && (
416+ < div
417+ style = { {
418+ position : "sticky" ,
419+ top : adjustedHeight - totalBotHeight ,
420+ left : 0 ,
421+ width : adjustedWidth ,
422+ } }
418423 >
419- { botLeftItems }
420- </ ScrollDiv >
421- </ div >
422- < div
423- style = { {
424- position : "sticky" ,
425- top : adjustedHeight - totalBotHeight ,
426- left : 0 ,
427- width : adjustedWidth ,
428- } }
429- >
430- < ScrollDiv
431- disableSticky = { disableSticky }
432- leftOffset = { 0 }
433- topOffset = { 0 }
434- top = { 0 }
435- left = { adjustedWidth - totalRightWidth }
424+ < ScrollDiv
425+ disableSticky = { disableSticky }
426+ leftOffset = { 0 }
427+ topOffset = { 0 }
428+ top = { 0 }
429+ left = { 0 }
430+ >
431+ { botLeftItems }
432+ </ ScrollDiv >
433+ </ div >
434+ ) }
435+ { /* Bot Right */ }
436+ { ! ! pinnedBottomCount && ! ! pinnedRightCount && (
437+ < div
438+ style = { {
439+ position : "sticky" ,
440+ top : adjustedHeight - totalBotHeight ,
441+ left : 0 ,
442+ width : adjustedWidth ,
443+ } }
436444 >
437- { botRightItems }
438- </ ScrollDiv >
439- </ div >
445+ < ScrollDiv
446+ disableSticky = { disableSticky }
447+ leftOffset = { 0 }
448+ topOffset = { 0 }
449+ top = { 0 }
450+ left = { adjustedWidth - totalRightWidth }
451+ >
452+ { botRightItems }
453+ </ ScrollDiv >
454+ </ div >
455+ ) }
440456 </ StickyDiv >
441457 </ div >
442458 </ div >
0 commit comments