From 8cfebca034a20fdfc19687078c8f58361ff64765 Mon Sep 17 00:00:00 2001
From: Mathis Neumann <mathis@simpletechs.net>
Date: Wed, 16 May 2018 16:29:21 +0200
Subject: [PATCH] support renderHeader property

---
 README.md                   | 1 +
 components/ModalDropdown.js | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index be5f49f..971fbcb 100644
--- a/README.md
+++ b/README.md
@@ -79,6 +79,7 @@ Prop                | Type     | Optional | Default   | Description
 `adjustFrame`       | func     | Yes      |           | This is a callback after the frame of the dropdown have been calculated and before showing. You will receive a style object as argument with some of the props like `width` `height` `top` `left` and `right`. Change them to appropriate values that accord with your requirement and **make the new style as the return value of this function**.
 `renderRow`         | func     | Yes      |           | Customize render option rows: `function(option,index,isSelected)` **Will render a default row if `null`/`undefined`.**
 `renderSeparator`   | func     | Yes      |           | Customize render dropdown list separators. **Will render a default thin gray line if `null`/`undefined`.**
+`renderHeader`      | func     | Yes      |           | Add a header to the top of the scrollable list
 `renderButtonText`  | func     | Yes      |           | Use this to extract and return text from option object. This text will show on button after option selected. **Invalid in wrapper mode.**
 `onDropdownWillShow`| func     | Yes      |           | Trigger when dropdown will show by touching the button. **Return `false` can cancel the event.**
 `onDropdownWillHide`| func     | Yes      |           | Trigger when dropdown will hide by touching the button. **Return `false` can cancel the event.**
diff --git a/components/ModalDropdown.js b/components/ModalDropdown.js
index 4dc5342..d9fda0b 100644
--- a/components/ModalDropdown.js
+++ b/components/ModalDropdown.js
@@ -53,6 +53,7 @@ export default class ModalDropdown extends Component {
     adjustFrame: PropTypes.func,
     renderRow: PropTypes.func,
     renderSeparator: PropTypes.func,
+    renderHeader: PropTypes.func,
     renderButtonText: PropTypes.func,
 
     onDropdownWillShow: PropTypes.func,
@@ -281,12 +282,13 @@ export default class ModalDropdown extends Component {
   }
 
   _renderDropdown() {
-    const {scrollEnabled, renderSeparator, showsVerticalScrollIndicator, keyboardShouldPersistTaps} = this.props;
+    const {scrollEnabled, renderSeparator, showsVerticalScrollIndicator, keyboardShouldPersistTaps, renderHeader} = this.props;
     return (
       <ListView scrollEnabled={scrollEnabled}
                 style={styles.list}
                 dataSource={this._dataSource}
                 renderRow={this._renderRow}
+                renderHeader={renderHeader}
                 renderSeparator={renderSeparator || this._renderSeparator}
                 automaticallyAdjustContentInsets={false}
                 showsVerticalScrollIndicator={showsVerticalScrollIndicator}