Skip to content

Commit

Permalink
Merge pull request #1892 from MarkSinD/feature
Browse files Browse the repository at this point in the history
ToolbarSelect should always shown
  • Loading branch information
patorjk committed Jan 3, 2023
2 parents c7a4020 + b7f82be commit e09c39c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/MUIDataTable.js
Expand Up @@ -108,6 +108,7 @@ const STP = {
REPLACE: 'replace',
ABOVE: 'above',
NONE: 'none',
ALWAYS: 'always'
};

class MUIDataTable extends React.Component {
Expand Down Expand Up @@ -242,7 +243,7 @@ class MUIDataTable extends React.Component {
setRowProps: PropTypes.func,
selectToolbarPlacement: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.oneOf([STP.REPLACE, STP.ABOVE, STP.NONE]),
PropTypes.oneOf([STP.REPLACE, STP.ABOVE, STP.NONE, STP.ALWAYS]),
]),
setTableProps: PropTypes.func,
sort: PropTypes.bool,
Expand Down Expand Up @@ -1932,7 +1933,7 @@ class MUIDataTable extends React.Component {

return (
<Paper elevation={this.options.elevation} ref={this.tableContent} className={paperClasses}>
{selectedRows.data.length > 0 && this.options.selectToolbarPlacement !== STP.NONE && (
{(this.options.selectToolbarPlacement === STP.ALWAYS || selectedRows.data.length > 0 && this.options.selectToolbarPlacement !== STP.NONE) && (
<TableToolbarSelectComponent
options={this.options}
selectedRows={selectedRows}
Expand Down

0 comments on commit e09c39c

Please sign in to comment.