Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/context_menu/context_menu_panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,10 @@ export class EuiContextMenuPanel extends Component {
getWatchedProps(items) {
const { watchedItemProps } = this.props;

// Create array of each item's watched properties
if(items && items.length && watchedItemProps && watchedItemProps.length) {
return items.map(item => {
// Create object of item properties and values
const props = {
key: item.key,
};
Expand All @@ -250,6 +252,7 @@ export class EuiContextMenuPanel extends Component {
return true;
}

// Check if any watched item properties changed by quick string comparison
if(JSON.stringify(this.getWatchedProps(nextProps.items)) !== JSON.stringify(this.getWatchedProps(this.props.items))) {
return true;
}
Expand Down