Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1059 from metasfresh/dev-1027
Browse files Browse the repository at this point in the history
line looks selected, but it's not #1027
  • Loading branch information
cadavre authored Jul 19, 2017
2 parents c4edeed + 041388d commit 864e4b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/app/DocumentList.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ class DocumentList extends Component {
render() {
const {
layout, data, viewId, clickOutsideLock, refresh, page, filters,
cachedSelection, isShowIncluded, hasShowIncluded
cachedSelection, isShowIncluded, hasShowIncluded, refreshSelection
} = this.state;

const {
Expand Down Expand Up @@ -581,7 +581,7 @@ class DocumentList extends Component {
disableOnClickOutside={clickOutsideLock}
defaultSelected={cachedSelection ?
cachedSelection : selected}
refreshSelection={this.state.refreshSelection}
refreshSelection={refreshSelection}
queryLimitHit={data.queryLimitHit}
doesSelectionExist={this.doesSelectionExist}
showIncludedViewOnSelect={this.showIncludedViewOnSelect}
Expand Down
11 changes: 10 additions & 1 deletion src/components/table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Table extends Component {
const {
mainTable, open, rowData, defaultSelected, disconnectFromState,
dispatch, type, refreshSelection, supportIncludedViewOnSelect,
showIncludedViewOnSelect
showIncludedViewOnSelect, viewId
} = this.props;

const {
Expand Down Expand Up @@ -112,6 +112,15 @@ class Table extends Component {
selected: defaultSelected
})
}

if(
JSON.stringify(prevProps.viewId) !==
JSON.stringify(viewId)
){
this.setState({
selected: []
})
}
}

showSelectedIncludedView = (selected) => {
Expand Down

0 comments on commit 864e4b0

Please sign in to comment.