From b0ef0cf7d69344cd6ebcc9572c6d228d809279b0 Mon Sep 17 00:00:00 2001 From: Aleksey Date: Tue, 27 Mar 2018 21:00:04 +0300 Subject: [PATCH 1/2] Update ModalDropdown.js --- components/ModalDropdown.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/ModalDropdown.js b/components/ModalDropdown.js index 4dc5342..aa8e516 100644 --- a/components/ModalDropdown.js +++ b/components/ModalDropdown.js @@ -171,6 +171,7 @@ export default class ModalDropdown extends Component { disabled={disabled} accessible={accessible} onPress={this._onButtonPress} + onLongPress={this._onButtonLongPress} > { children || @@ -196,6 +197,12 @@ export default class ModalDropdown extends Component { } }; + _onButtonLongPress = () => { + if (this.props.onLongPress) { + this.props.onLongPress(); + } + } + _renderModal() { const {animated, accessible, dropdownStyle} = this.props; const {showDropdown, loading} = this.state; From d6b8c285ff3a5f1ce94b0f2b6dc310fecdb41b1d Mon Sep 17 00:00:00 2001 From: Aleksey Date: Tue, 27 Mar 2018 21:06:42 +0300 Subject: [PATCH 2/2] Added event description --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index be5f49f..ce68a9a 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ Prop | Type | Optional | Default | Description `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.** `onSelect` | func | Yes | | Trigger when option row touched with selected `index` and `value`. **Return `false` can cancel the event.** +`onLongPress` | func | Yes | | Trigger when the button has received `onLongPress` event `accessible` | bool | Yes | true | Set accessibility of dropdown modal and dropdown rows `keyboardShouldPersistTaps` | enum('always', 'never', 'handled') | Yes | 'never' | See react-native `ScrollView` props