Skip to content

Commit

Permalink
rebase master, fix inlineIndent propsTypes oneOfType is Array
Browse files Browse the repository at this point in the history
  • Loading branch information
jljsj33 committed Apr 24, 2018
1 parent dd8ae62 commit 95a42e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/MenuItemGroup.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { menuInheritProps } from './util';
import { menuAllProps } from './util';

class MenuItemGroup extends React.Component {
static propTypes = {
Expand All @@ -25,7 +25,7 @@ class MenuItemGroup extends React.Component {
const { className = '', rootPrefixCls } = props;
const titleClassName = `${rootPrefixCls}-item-group-title`;
const listClassName = `${rootPrefixCls}-item-group-list`;
const { title } = props;
const { title, children } = props;
menuAllProps.forEach(key => delete props[key]);
return (
<li {...props} className={`${className} ${rootPrefixCls}-item-group`}>
Expand All @@ -36,7 +36,7 @@ class MenuItemGroup extends React.Component {
{title}
</div>
<ul className={listClassName}>
{React.Children.map(props.children, this.renderInnerMenuItem)}
{React.Children.map(children, this.renderInnerMenuItem)}
</ul>
</li>
);
Expand Down
7 changes: 3 additions & 4 deletions src/SubPopupMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { connect } from 'mini-store';
import KeyCode from 'rc-util/lib/KeyCode';
import createChainedFunction from 'rc-util/lib/createChainedFunction';
import classNames from 'classnames';
import { getKeyFromChildrenIndex, loopMenuItem, noop, menuInheritProps } from './util';
import { getKeyFromChildrenIndex, loopMenuItem, noop, menuAllProps } from './util';
import DOMWrap from './DOMWrap';

function allDisabled(arr) {
Expand Down Expand Up @@ -87,7 +87,7 @@ export class SubPopupMenu extends React.Component {
level: PropTypes.number,
mode: PropTypes.oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']),
triggerSubMenuAction: PropTypes.oneOf(['click', 'hover']),
inlineIndent: PropTypes.oneOfType(PropTypes.number, PropTypes.string),
inlineIndent: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
manualRef: PropTypes.func,
};

Expand Down Expand Up @@ -304,7 +304,7 @@ export class SubPopupMenu extends React.Component {
};

render() {
const props = this.props;
const { ...props } = this.props;
this.instanceArray = [];
const className = classNames(
props.prefixCls,
Expand All @@ -330,7 +330,6 @@ export class SubPopupMenu extends React.Component {
/* eslint-disable */
<DOMWrap
{...props}
style={props.style}
tag="ul"
hiddenClassName={`${prefixCls}-hidden`}
visible={visible}
Expand Down

0 comments on commit 95a42e1

Please sign in to comment.