Skip to content

Commit

Permalink
[Fix]: Table graph select column issue (#464)
Browse files Browse the repository at this point in the history
* [Fix]: Table graph select column issue

* [Done]: Feedback changes
  • Loading branch information
nxanil authored Apr 26, 2021
1 parent daadf64 commit a462a30
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Graphs/Table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ let container = '';
let selectedRows = [];
let displayColumn = [];
let unformattedData = {};
let isAllColumnSelected = false;

const getGraphProperties = (props) => {
const {
Expand Down Expand Up @@ -175,7 +176,7 @@ const TableGraph = (props) => {
updateScroll,
} = props;

if (!isEmpty(displayColumn)) {
if (!isEmpty(displayColumn) || isAllColumnSelected) {
updateScroll({
[`removedColumn`]: displayColumn,
event: events.REMOVED_COLUMNS
Expand Down Expand Up @@ -562,7 +563,7 @@ const TableGraph = (props) => {
value={stateColumn}
onChange={handleColumnSelection}
renderValue={(selected) => 'Select Columns'}
MenuProps={MenuProps}s
MenuProps={MenuProps}
classes={{
root: 'select-column',
selectMenu: 'select-column',
Expand Down Expand Up @@ -593,6 +594,7 @@ const TableGraph = (props) => {

const handleColumnSelection = (event) => {
displayColumn = event.target.value;
isAllColumnSelected = isEmpty(displayColumn) ? true : false;
setStateColumn(event.target.value);
}

Expand Down

0 comments on commit a462a30

Please sign in to comment.