Question regarding MenuBar
Posted: 02 Nov 2017, 15:55
I have a question regarding the Menubar.
I am using it in a project I am working on and noticed the following problem. I use disabled state of the items to mark the currently active MenuItem. It works well except for one thing. When I navigate via a Button that just uses the push method of react-router-redux through this.props.history, everything is rerendered correctly, but the MenuItem created by the NestedMenuItem inside the Menubar is not updated and still has disabled set to true for the last active item.
Every props and states seem to be ok and every render method is called as expected. Only the MenuItem is not updated and still shows disabled: true in its properties and the render method is not called for this component either.
Is that expected behaviour or am I doing something unexpected or wrong?
The MenuItem causing the problem is created in NestedMenuItem.js from line 105:
I am using it in a project I am working on and noticed the following problem. I use disabled state of the items to mark the currently active MenuItem. It works well except for one thing. When I navigate via a Button that just uses the push method of react-router-redux through this.props.history, everything is rerendered correctly, but the MenuItem created by the NestedMenuItem inside the Menubar is not updated and still has disabled set to true for the last active item.
Code: Select all
<Button id="loginWithLabel"
label="LOG-IN"
icon="fa-sign-in"
onClick={() => { this.navigateTo('/login') }} />
navigateTo = (urlPart) => {
...
//navigate to internal URL
this.props.history.push(urlPart);
...
}
Is that expected behaviour or am I doing something unexpected or wrong?
The MenuItem causing the problem is created in NestedMenuItem.js from line 105:
Code: Select all
_react2.default.createElement(_MenuItem.MenuItem, { items: this.props.item, onItemClick: function onItemClick(event) {
return _this2.itemClick(event, _this2.props.item);
}, root: this.props.root, parentMenu: this.props.parentMenu })