Skip to content

Commit

Permalink
Merge pull request JedWatson#1408 from khankuan/patch-1
Browse files Browse the repository at this point in the history
Provide `isOpen` to arrowRenderer
  • Loading branch information
JedWatson authored Jan 31, 2017
2 parents 00418b3 + 080670c commit 9bebcd0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ function onInputKeyDown(event) {
Property | Type | Default | Description
:-----------------------|:--------------|:--------------|:--------------------------------
addLabelText | string | 'Add "{label}"?' | text to display when `allowCreate` is true
arrowRenderer | func | undefined | Renders a custom drop-down arrow to be shown in the right-hand side of the select: `arrowRenderer({ onMouseDown })`
arrowRenderer | func | undefined | Renders a custom drop-down arrow to be shown in the right-hand side of the select: `arrowRenderer({ onMouseDown, isOpen })`
autoBlur | bool | false | Blurs the input element after a selection has been made. Handy for lowering the keyboard on mobile devices
autofocus | bool | undefined | autofocus the component on mount
autoload | bool | true | whether to auto-load the default async options set
Expand Down
3 changes: 2 additions & 1 deletion src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,8 @@ const Select = React.createClass({

renderArrow () {
const onMouseDown = this.handleMouseDownOnArrow;
const arrow = this.props.arrowRenderer({ onMouseDown });
const isOpen = this.state.isOpen;
const arrow = this.props.arrowRenderer({ onMouseDown, isOpen });

return (
<span
Expand Down

0 comments on commit 9bebcd0

Please sign in to comment.