Skip to content

Commit

Permalink
chore: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
picodoth committed May 7, 2018
1 parent 0bc6b57 commit b24f77b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/DOMWrap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ export default class DOMWrap extends React.Component {
delete props.tag;
delete props.hiddenClassName;
delete props.visible;
// Otherwise, the propagated click event will trigger another onClick
props.onClick = null;
return <Tag {...props} />;
}
}
3 changes: 2 additions & 1 deletion src/SubMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,14 @@ export class SubMenu extends React.Component {
} = props;
menuAllProps.forEach(key => delete props[key]);
// Set onClick to null, to ignore propagated onClick event
delete props.onClick;

return (
<li
{...props}
{...mouseEvents}
className={className}
role="menuitem"
onClick={null}
>
{isInlineMode && title}
{isInlineMode && children}
Expand Down
3 changes: 3 additions & 0 deletions src/SubPopupMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ export class SubPopupMenu extends React.Component {
}
const { prefixCls, eventKey, visible } = props;
menuAllProps.forEach(key => delete props[key]);

// Otherwise, the propagated click event will trigger another onClick
delete props.onClick;
return (
// ESLint is not smart enough to know that the type of `children` was checked.
/* eslint-disable */
Expand Down

0 comments on commit b24f77b

Please sign in to comment.