File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -142,9 +142,13 @@ export const Table = <T extends KeyValue = KeyValue>({
142
142
style = { {
143
143
gridTemplate : `"head" auto "loader" auto "content" 1fr "foot" auto/1fr` ,
144
144
} }
145
+ data-ref = "tableScroller"
145
146
ref = { scrollerRef }
146
147
>
147
- < div className = "bg-base font-medium sticky top-0 area-head border-b select-none flex flex-nowrap z-2" >
148
+ < div
149
+ data-ref = "tableHeader"
150
+ className = "bg-base font-medium sticky top-0 area-head border-b select-none flex flex-nowrap z-2"
151
+ >
148
152
< div className = { wrapperStart } >
149
153
{ canExpand && < div className = "w-6" /> }
150
154
{ checkableRows && (
Original file line number Diff line number Diff line change @@ -47,13 +47,15 @@ export const useResizer = (
47
47
/** ***************** attach handlers *******************/
48
48
const box = colEl . getBoundingClientRect ( ) ;
49
49
if ( colEl . parentElement != null ) {
50
- const parentBox = colEl . parentElement ?. getBoundingClientRect ( ) ;
50
+ const parentBox = colEl
51
+ . closest ( "[data-ref='tableScroller']" )
52
+ ?. getBoundingClientRect ( ) as unknown as DOMRect ;
51
53
if ( isRtl ) {
52
54
placeholder . style . left = "unset" ;
53
- placeholder . style . right = `${ box . right - parentBox . right } px` ;
55
+ placeholder . style . right = `${ parentBox . width - box . right } px` ;
54
56
} else {
55
57
placeholder . style . right = "unset" ;
56
- placeholder . style . left = `${ box . left - parentBox . left } px` ;
58
+ placeholder . style . left = `${ box . left } px` ;
57
59
}
58
60
}
59
61
placeholder . style . width = `${ colEl . offsetWidth } px` ;
You can’t perform that action at this time.
0 commit comments