From 50b7be976accd4997202585e4ee42f8e9f73f565 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Tue, 16 Jun 2020 14:20:04 -0600 Subject: [PATCH] [EuiBasicTable] Custom actions in a collapsed actions menu should close popover on click (#3619) * custom actions in collapsed actions menu close popover on click * CL --- CHANGELOG.md | 1 + .../basic_table/collapsed_item_actions.tsx | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8574e43b874..28a7f591195 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ - Fixed `euiHeaderAffordForFixed` mixin's use of header SASS variable ([#3592](https://github.com/elastic/eui/pull/3592)) - Included `onClick` as a valid prop for `EuiControlBar` **icon** controls ([#3581](https://github.com/elastic/eui/pull/3581)) - Fixed poor performance of `EuiToolTip` during frequent mouesover/mouseout events ([#3596](https://github.com/elastic/eui/pull/3596)) +- Fixed `EuiBasicTable` custom actions popover from remaining open after click ([#3619](https://github.com/elastic/eui/pull/3619)) **Breaking changes** diff --git a/src/components/basic_table/collapsed_item_actions.tsx b/src/components/basic_table/collapsed_item_actions.tsx index 23cf65c22bb..d9a1cbcdc47 100644 --- a/src/components/basic_table/collapsed_item_actions.tsx +++ b/src/components/basic_table/collapsed_item_actions.tsx @@ -128,10 +128,12 @@ export class CollapsedItemActions extends Component< controls.push( {} + onClick={() => + this.onClickItem( + actionControlOnClick + ? () => actionControlOnClick(item) + : undefined + ) }> {actionControl} @@ -159,10 +161,9 @@ export class CollapsedItemActions extends Component< target={target} icon={icon} data-test-subj={dataTestSubj} - onClick={this.onClickItem.bind( - null, - onClick ? onClick.bind(null, item) : undefined - )}> + onClick={() => + this.onClickItem(onClick ? () => onClick(item) : undefined) + }> {name} );