File tree 2 files changed +6
-33
lines changed
react-table/__tests__/features/__snapshots__
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
4
4
{
5
5
" footers" : [
6
6
[],
7
- [],
8
- [],
9
7
],
10
8
" headers" : [
11
9
[],
12
- [],
13
- [],
14
10
],
15
11
" rows" : [
16
12
[],
@@ -304,20 +300,6 @@ exports[`useReactTable > can toggle column visibility > 3 - after toggling More
304
300
" 1" ,
305
301
],
306
302
],
307
- [
308
- [
309
- " " ,
310
- " 1" ,
311
- ],
312
- [
313
- " " ,
314
- " 1" ,
315
- ],
316
- [
317
- " " ,
318
- " 1" ,
319
- ],
320
- ],
321
303
[
322
304
[
323
305
" Name" ,
@@ -340,20 +322,6 @@ exports[`useReactTable > can toggle column visibility > 3 - after toggling More
340
322
" 1" ,
341
323
],
342
324
],
343
- [
344
- [
345
- " " ,
346
- " 1" ,
347
- ],
348
- [
349
- " " ,
350
- " 1" ,
351
- ],
352
- [
353
- " " ,
354
- " 1" ,
355
- ],
356
- ],
357
325
[
358
326
[
359
327
" firstName" ,
Original file line number Diff line number Diff line change @@ -178,7 +178,12 @@ export const Visibility: TableFeature = {
178
178
}
179
179
}
180
180
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
+ )
182
187
}
183
188
184
189
column . getCanHide = ( ) => {
You can’t perform that action at this time.
0 commit comments