Skip to content

Commit 1036db4

Browse files
NinoZXmtrezza
authored andcommitted
setCurrent to null on BrowserMenu open
1 parent 25ceb7e commit 1036db4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/components/BrowserMenu/BrowserMenu.react.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export default class BrowserMenu extends React.Component {
6262
if (!this.props.disabled) {
6363
onClick = () => {
6464
this.setState({ open: true });
65+
this.props.setCurrent(null);
6566
};
6667
}
6768
return (

src/dashboard/Data/Browser/BrowserToolbar.react.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ let BrowserToolbar = ({
9292
let menu = null;
9393
if (relation) {
9494
menu = (
95-
<BrowserMenu title='Edit' icon='edit-solid'>
95+
<BrowserMenu title='Edit' icon='edit-solid' setCurrent={setCurrent}>
9696
<MenuItem
9797
text={`Create ${relation.targetClassName} and attach`}
9898
onClick={onAddRow}
@@ -111,7 +111,7 @@ let BrowserToolbar = ({
111111
);
112112
} else if (onAddRow) {
113113
menu = (
114-
<BrowserMenu title='Edit' icon='edit-solid' disabled={isUnique}>
114+
<BrowserMenu title='Edit' icon='edit-solid' disabled={isUnique} setCurrent={setCurrent}>
115115
<MenuItem text='Add a row' onClick={onAddRow} />
116116
<MenuItem text='Add a row with modal' onClick={onAddRowWithModal} />
117117
{enableColumnManipulation ? <MenuItem text='Add a column' onClick={onAddColumn} /> : <noscript />}

0 commit comments

Comments
 (0)