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

Commit

Permalink
fix line looks selected, but it's not #1027
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunkat committed Jul 19, 2017
1 parent 1d0893f commit 041388d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/components/app/DocumentList.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ class DocumentList extends Component {
cachedSelection && !disconnectFromState &&
dispatch(selectTableItems(cachedSelection, windowType))
this.setState({
refreshSelection: true,
cachedSelection: null
refreshSelection: true
}, () => this.setState({
refreshSelection: false
}))
Expand Down Expand Up @@ -482,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 @@ -582,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 041388d

Please sign in to comment.