Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: patternfly/react-topology
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5eff3e502e188e1bfac3f1f79b67bf9957fe7b52
Choose a base ref
..
head repository: patternfly/react-topology
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 126476ab80dfb97cdc2721a6327f3d7eb4cc563b
Choose a head ref
Showing with 5 additions and 2 deletions.
  1. +5 −2 packages/module/src/components/contextmenu/ContextSubMenuItem.tsx
Original file line number Diff line number Diff line change
@@ -12,8 +12,11 @@ interface ContextSubMenuItemProps {
}

/**
* Check if an event target is also a [Node](https://developer.mozilla.org/en-US/docs/Web/API/Node).
* Needed to stop runtime errors where the target does not implement Node.
* Check if an event target implements the [DOM Node interface][1].
* Needed to prevent runtime errors where the event target is not a DOM node,
* but `contains` is still called on it.
*
* [1]: https://developer.mozilla.org/en-US/docs/Web/API/Node
*/
const implementsDOMNode = (node: any): boolean => {
return node && typeof node === 'object' && node.nodeType && node.nodeName;