Skip to content

Commit

Permalink
revert #10
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminghe committed Jul 27, 2016
1 parent f6ff403 commit f304a24
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# History
----

## 1.5.0 / 2016-07-27

-

## 1.4.5 / 2016-03-02

- if exists getPopupContainer it will be passed to Trigger component
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,19 @@ npm start

## Test Case

http://localhost:8006/tests/runner.html?coverage
```
npm test
npm run chrome-test
```

## Coverage

http://localhost:8006/node_modules/rc-server/node_modules/node-jscover/lib/front-end/jscoverage.html?w=http://localhost:8006/tests/runner.html?coverage
```
npm run coverage
```

open coverage/ dir


## License

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rc-dropdown",
"version": "1.4.9",
"version": "1.4.10",
"description": "dropdown ui component for react",
"keywords": [
"react",
Expand Down
10 changes: 7 additions & 3 deletions src/Dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import Trigger from 'rc-trigger';
import placements from './placements';

/*
var MenuItem = Menu.Item;
var menu = <Menu><MenuItem>1</MenuItem></Menu>;
<DropDown trigger="click" animationName="" overlay={<>} onSelect={}>
<button>open</button>
</DropDown>
*/
*/

const Dropdown = React.createClass({
propTypes: {
Expand Down Expand Up @@ -71,7 +70,12 @@ const Dropdown = React.createClass({
onClick(e) {
const props = this.props;
const overlayProps = props.overlay.props;
this.onVisibleChange(false);
// do no call onVisibleChange, if you need click to hide, use onClick and control visible
if (!('visible' in props)) {
this.setState({
visible: false,
});
}
if (overlayProps.onClick) {
overlayProps.onClick(e);
}
Expand Down

0 comments on commit f304a24

Please sign in to comment.