From 9f80f462a8e941879b5c122b7aade68d708e2006 Mon Sep 17 00:00:00 2001 From: Hugo Silva Date: Thu, 11 Aug 2016 14:03:34 +1200 Subject: [PATCH 1/3] included activeClassName prop --- components/Dropdown.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/Dropdown.jsx b/components/Dropdown.jsx index d07c098..79578c4 100644 --- a/components/Dropdown.jsx +++ b/components/Dropdown.jsx @@ -16,7 +16,8 @@ var Dropdown = createClass({ getDefaultProps () { return { - className: '' + className: '', + activeClassName: 'dropdown--active' } }, @@ -34,7 +35,7 @@ var Dropdown = createClass({ const active = this.isActive(); var dropdown_classes = cx({ dropdown: true, - 'dropdown--active': active + [activeClassName]: active }); dropdown_classes += ' ' + className; // stick callback on trigger element From 49dde8fffef18e65c7482ed4745b1d0168cb5044 Mon Sep 17 00:00:00 2001 From: Hugo Silva Date: Thu, 11 Aug 2016 14:12:09 +1200 Subject: [PATCH 2/3] included activeClassName prop --- components/Dropdown.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Dropdown.jsx b/components/Dropdown.jsx index 79578c4..9eee47c 100644 --- a/components/Dropdown.jsx +++ b/components/Dropdown.jsx @@ -30,7 +30,7 @@ var Dropdown = createClass({ }, render () { - const { children, className } = this.props; + const { children, className, activeClassName } = this.props; // create component classes const active = this.isActive(); var dropdown_classes = cx({ From ea5ff9bf1bb4420c9f5dc6ebc847cb9431ba71be Mon Sep 17 00:00:00 2001 From: Hugo Silva Date: Thu, 11 Aug 2016 18:01:49 +1200 Subject: [PATCH 3/3] included reference to new prop in documentation --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 932dae5..2a5dc39 100644 --- a/README.md +++ b/README.md @@ -63,4 +63,5 @@ Property | Type | Description ----- | ----- | ----- **show** | *boolean* | Manually show/hide the `DropdownContent`. Make sure to unset this or the dropdown will stay open. **onShow** | *function* | Callback for when `DropdownContent` is shown. -**onHide** | *function* | Callback for when `DropdownContent` is hidden. \ No newline at end of file +**onHide** | *function* | Callback for when `DropdownContent` is hidden. +**activeClassName** | *string* | Class to be applied to the dropdown when active. Default value: 'dropdown--active' \ No newline at end of file