This repository was archived by the owner on Jul 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
plugins/plugin-client-common/src/components/spi/DropDown/impl Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -23,18 +23,35 @@ import Icons from '../../Icons'
23
23
import '../../../../../web/scss/components/DropDown/Carbon.scss'
24
24
25
25
export default class CarbonDropDown extends React . PureComponent < Props > {
26
+ private isOpen = false
27
+
28
+ /** re: isOpen, see the comment for the onOpen() method */
26
29
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
29
35
}
30
36
}
31
37
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
+
32
48
public render ( ) {
33
49
return (
34
50
< OverflowMenu
35
51
flipped
36
52
menuOptionsClass = { this . props . className }
37
53
className = { this . props . className }
54
+ onOpen = { this . onOpen . bind ( this ) }
38
55
onClose = { this . onClose . bind ( this ) }
39
56
>
40
57
{ this . props . actions . map ( ( _ , idx ) => {
You can’t perform that action at this time.
0 commit comments