Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 866451c

Browse files
committed
fix(plugins/plugin-client-common): Terminal focus changes unexpectedly
works around bug in carbon-components-react's OverflowMenu Fixes #5170
1 parent e4872b2 commit 866451c

File tree

1 file changed

+19
-2
lines changed
  • plugins/plugin-client-common/src/components/spi/DropDown/impl

1 file changed

+19
-2
lines changed

plugins/plugin-client-common/src/components/spi/DropDown/impl/Carbon.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,35 @@ import Icons from '../../Icons'
2323
import '../../../../../web/scss/components/DropDown/Carbon.scss'
2424

2525
export default class CarbonDropDown extends React.PureComponent<Props> {
26+
private isOpen = false
27+
28+
/** re: isOpen, see the comment for the onOpen() method */
2629
private onClose() {
27-
if (this.props.onClose) {
28-
this.props.onClose()
30+
if (this.isOpen) {
31+
if (this.props.onClose) {
32+
this.props.onClose()
33+
}
34+
this.isOpen = false
2935
}
3036
}
3137

38+
/**
39+
* This will no longer be needed once we update to
40+
* carbon-components-react
41+
* 10.16. https://github.com/carbon-design-system/carbon/pull/6083
42+
*
43+
*/
44+
private onOpen() {
45+
this.isOpen = true
46+
}
47+
3248
public render() {
3349
return (
3450
<OverflowMenu
3551
flipped
3652
menuOptionsClass={this.props.className}
3753
className={this.props.className}
54+
onOpen={this.onOpen.bind(this)}
3855
onClose={this.onClose.bind(this)}
3956
>
4057
{this.props.actions.map((_, idx) => {

0 commit comments

Comments
 (0)