Skip to content

Commit

Permalink
feat: support Dropdown[disabled]
Browse files Browse the repository at this point in the history
  • Loading branch information
benjycui committed Oct 28, 2016
1 parent f304a24 commit 247be5f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@ var Dropdown = require('rc-dropdown');
<td></td>
<td>whether tooltip is visible initially</td>
</tr>
<tr>
<td>trigger</td>
<td>Array</td>
<td>['hover']</td>
<td>which actions cause dropdown shown. enum of 'hover','click','focus'</td>
</tr>
<tr>
<td>disabled</td>
<td>boolean</td>
<td>false</td>
<td>whether to disabled all the trigger, showAction, hideAction</td>
</tr>
<tr>
<td>overlay</td>
<td>rc-menu</td>
Expand Down
9 changes: 5 additions & 4 deletions src/Dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const Dropdown = React.createClass({
align: PropTypes.object,
overlayStyle: PropTypes.object,
placement: PropTypes.string,
disabled: PropTypes.boolean,
trigger: PropTypes.array,
showAction: PropTypes.array,
hideAction: PropTypes.array,
Expand Down Expand Up @@ -120,7 +121,7 @@ const Dropdown = React.createClass({
align, placement, getPopupContainer,
showAction, hideAction,
overlayClassName, overlayStyle,
trigger, ...otherProps,
disabled, trigger, ...otherProps,
} = this.props;
return (<Trigger
{...otherProps}
Expand All @@ -129,9 +130,9 @@ const Dropdown = React.createClass({
popupClassName={overlayClassName}
popupStyle={overlayStyle}
builtinPlacements={placements}
action={trigger}
showAction={showAction}
hideAction={hideAction}
action={disabled ? [] : trigger}
showAction={disabled ? [] : showAction}
hideAction={disabled ? [] : hideAction}
popupPlacement={placement}
popupAlign={align}
popupTransitionName={transitionName}
Expand Down

0 comments on commit 247be5f

Please sign in to comment.