File tree Expand file tree Collapse file tree 2 files changed +6
-33
lines changed
react-table/__tests__/features/__snapshots__ Expand file tree Collapse file tree 2 files changed +6
-33
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,9 @@ exports[`useReactTable > can toggle column visibility > 0 - after toggling all o
44{
55 " footers" : [
66 [],
7- [],
8- [],
97 ],
108 " headers" : [
119 [],
12- [],
13- [],
1410 ],
1511 " rows" : [
1612 [],
@@ -304,20 +300,6 @@ exports[`useReactTable > can toggle column visibility > 3 - after toggling More
304300 " 1" ,
305301 ],
306302 ],
307- [
308- [
309- " " ,
310- " 1" ,
311- ],
312- [
313- " " ,
314- " 1" ,
315- ],
316- [
317- " " ,
318- " 1" ,
319- ],
320- ],
321303 [
322304 [
323305 " Name" ,
@@ -340,20 +322,6 @@ exports[`useReactTable > can toggle column visibility > 3 - after toggling More
340322 " 1" ,
341323 ],
342324 ],
343- [
344- [
345- " " ,
346- " 1" ,
347- ],
348- [
349- " " ,
350- " 1" ,
351- ],
352- [
353- " " ,
354- " 1" ,
355- ],
356- ],
357325 [
358326 [
359327 " firstName" ,
Original file line number Diff line number Diff line change @@ -178,7 +178,12 @@ export const Visibility: TableFeature = {
178178 }
179179 }
180180 column . getIsVisible = ( ) => {
181- return table . getState ( ) . columnVisibility ?. [ column . id ] ?? true
181+ const childColumns = column . columns
182+ return (
183+ ( childColumns . length
184+ ? childColumns . some ( c => c . getIsVisible ( ) )
185+ : table . getState ( ) . columnVisibility ?. [ column . id ] ) ?? true
186+ )
182187 }
183188
184189 column . getCanHide = ( ) => {
You can’t perform that action at this time.
0 commit comments