Skip to content

Commit

Permalink
fix: the last Table column is not calculated when the columns have a … (
Browse files Browse the repository at this point in the history
#1564)

* fix: the last Table column is not calculated when the columns have a width fixed

fix: #1552

* fix: modify some values

* fix: modify comment

Co-authored-by: Tahimi <tahimileon@gmail.com>
  • Loading branch information
rgah2107 and TahimiLeonBravo committed May 21, 2020
1 parent daa09b7 commit 18353ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export default class Table extends Component {
const { minColumnWidth, maxColumnWidth } = this.props;
const domTableWidth = this.getTableWidthFromDom();
const minColWidth = Number(minColumnWidth) || 50;
const maxColWidth = Number(maxColumnWidth) || 1000;
const maxColWidth = Number(maxColumnWidth) || Infinity;
const updatedColumns = getUpdatedColumns({
columns: newColumns || columns,
domTableWidth,
Expand Down Expand Up @@ -405,7 +405,7 @@ export default class Table extends Component {
};
const maxRowSelection = this.getMaxRowSelection();
const minColWidth = Number(minColumnWidth) || 50;
const maxColWidth = Number(maxColumnWidth) || 1000;
const maxColWidth = Number(maxColumnWidth) || 5000;

const isEmpty = data.length === 0;

Expand Down Expand Up @@ -490,7 +490,7 @@ Table.propTypes = {
resizeColumnDisabled: PropTypes.bool,
/** The minimum width for all columns. The default value is 50px. */
minColumnWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
/** The maximum width for all columns. The default value is 1000px. */
/** The maximum width for all columns. The default value is Infinity. */
maxColumnWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
/** Show or hide the checkbox column for row selection. To show set
* showCheckboxColumn to true. The default value is false. */
Expand Down Expand Up @@ -540,7 +540,7 @@ Table.defaultProps = {
onSort: () => {},
resizeColumnDisabled: false,
minColumnWidth: 50,
maxColumnWidth: 1000,
maxColumnWidth: Infinity,
showCheckboxColumn: false,
onRowSelection: () => {},
maxRowSelection: undefined,
Expand Down

0 comments on commit 18353ab

Please sign in to comment.