Skip to content

Commit

Permalink
setCurrent to null on BrowserMenu open
Browse files Browse the repository at this point in the history
  • Loading branch information
NinoZX authored and mtrezza committed Jul 31, 2021
1 parent 25ceb7e commit 1036db4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/BrowserMenu/BrowserMenu.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default class BrowserMenu extends React.Component {
if (!this.props.disabled) {
onClick = () => {
this.setState({ open: true });
this.props.setCurrent(null);
};
}
return (
Expand Down
4 changes: 2 additions & 2 deletions src/dashboard/Data/Browser/BrowserToolbar.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ let BrowserToolbar = ({
let menu = null;
if (relation) {
menu = (
<BrowserMenu title='Edit' icon='edit-solid'>
<BrowserMenu title='Edit' icon='edit-solid' setCurrent={setCurrent}>
<MenuItem
text={`Create ${relation.targetClassName} and attach`}
onClick={onAddRow}
Expand All @@ -111,7 +111,7 @@ let BrowserToolbar = ({
);
} else if (onAddRow) {
menu = (
<BrowserMenu title='Edit' icon='edit-solid' disabled={isUnique}>
<BrowserMenu title='Edit' icon='edit-solid' disabled={isUnique} setCurrent={setCurrent}>
<MenuItem text='Add a row' onClick={onAddRow} />
<MenuItem text='Add a row with modal' onClick={onAddRowWithModal} />
{enableColumnManipulation ? <MenuItem text='Add a column' onClick={onAddColumn} /> : <noscript />}
Expand Down

0 comments on commit 1036db4

Please sign in to comment.