Skip to content

Commit

Permalink
Add closePopover action
Browse files Browse the repository at this point in the history
  • Loading branch information
sulemanof committed Dec 15, 2020
1 parent d9e7c96 commit d16b81a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/plugins/vis_type_table/public/components/table_vis_columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const createGridColumns = (
(col, colIndex): EuiDataGridColumn => {
const cellActions = col.filterable
? [
({ rowIndex, columnId, Component }: EuiDataGridColumnCellActionProps) => {
({ rowIndex, columnId, Component, closePopover }: EuiDataGridColumnCellActionProps) => {
const rowValue = rows[rowIndex][columnId];
const contentsIsDefined = rowValue !== null && rowValue !== undefined;
const cellContent = col.formatter.convert(rowValue);
Expand All @@ -102,17 +102,18 @@ export const createGridColumns = (
<Component
aria-label={filterForAriaLabel}
data-test-subj="tbvChartCell__filterForCellValue"
onClick={() =>
onFilterClick({ row: rowIndex, column: colIndex, value: rowValue }, false)
}
onClick={() => {
onFilterClick({ row: rowIndex, column: colIndex, value: rowValue }, false);
closePopover();
}}
iconType="plusInCircle"
>
{filterForText}
</Component>
)
);
},
({ rowIndex, columnId, Component }: EuiDataGridColumnCellActionProps) => {
({ rowIndex, columnId, Component, closePopover }: EuiDataGridColumnCellActionProps) => {
const rowValue = rows[rowIndex][columnId];
const contentsIsDefined = rowValue !== null && rowValue !== undefined;
const cellContent = col.formatter.convert(rowValue);
Expand All @@ -137,9 +138,10 @@ export const createGridColumns = (
contentsIsDefined && (
<Component
aria-label={filterOutAriaLabel}
onClick={() =>
onFilterClick({ row: rowIndex, column: colIndex, value: rowValue }, true)
}
onClick={() => {
onFilterClick({ row: rowIndex, column: colIndex, value: rowValue }, true);
closePopover();
}}
iconType="minusInCircle"
>
{filterOutText}
Expand Down

0 comments on commit d16b81a

Please sign in to comment.