Omit invisible columns from horizontallyScrollable ManagedTables' width
Summary: Currently, `horizontallyScrollable` logic includes even invisible columns in the width calculation for `horizontallyScrollable` `ManagedTable`s, resulting in large empty spaces when many columns are invisible. Reviewed By: danielbuechele Differential Revision: D16139713 fbshipit-source-id: f653121845fbeac8a29bdb67ad0309add28e526a
This commit is contained in:
committed by
Facebook Github Bot
parent
385d9ded57
commit
4f4d9fa76e
@@ -650,8 +650,14 @@ class ManagedTable extends React.Component<
|
||||
|
||||
let computedWidth = 0;
|
||||
if (horizontallyScrollable) {
|
||||
for (const col in columnSizes) {
|
||||
const width = columnSizes[col];
|
||||
for (let index = 0; index < columnOrder.length; index++) {
|
||||
const col = columnOrder[index];
|
||||
|
||||
if (!col.visible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const width = columnSizes[col.key];
|
||||
if (isNaN(width)) {
|
||||
// non-numeric columns with, can't caluclate
|
||||
computedWidth = 0;
|
||||
|
||||
Reference in New Issue
Block a user