Skip to content

Commit

Permalink
New events on Dropdown component #90
Browse files Browse the repository at this point in the history
  • Loading branch information
Merve7 committed Sep 19, 2017
1 parent 899a1eb commit 0b1ab4f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export class Dropdown extends Component {
lazy: true,
panelStyleClass: null,
panelStyle: null,
dataKey: null
dataKey: null,
onMouseDown: null,
onContextMenu: null
};

static propTypes = {
Expand All @@ -55,7 +57,9 @@ export class Dropdown extends Component {
lazy: PropTypes.bool,
panelStyleClass: PropTypes.string,
panelStyle: PropTypes.string,
dataKey: PropTypes.string
dataKey: PropTypes.string,
onMouseDown: PropTypes.func,
onContextMenu: PropTypes.func
};

constructor(props) {
Expand Down Expand Up @@ -536,7 +540,8 @@ export class Dropdown extends Component {


return (
<div id={this.props.id} ref={(el) => this.container = el} className={styleClass} style={this.props.style} onClick={this.onMouseclick}>
<div id={this.props.id} ref={(el) => this.container = el} className={styleClass} style={this.props.style} onClick={this.onMouseclick}
onMouseDown={this.props.onMouseDown} onContextMenu={this.props.onContextMenu}>
{hiddenSelectElement}
{hiddenInputElement}
{labelElement}
Expand Down
10 changes: 10 additions & 0 deletions src/showcase/dropdown/DropdownDemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,16 @@ render() {
event.value: Value of the checkbox </td>
<td>Callback to invoke on value change</td>
</tr>
<tr>
<td>onMouseDown</td>
<td>event: Browser event</td>
<td>Callback to invoke to when a mouse button is pressed.</td>
</tr>
<tr>
<td>onContextMenu</td>
<td>event: Browser event</td>
<td>Callback to invoke on right-click.</td>
</tr>
</tbody>
</table>
</div>
Expand Down

0 comments on commit 0b1ab4f

Please sign in to comment.