Skip to content

Commit 88b8412

Browse files
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # components/ModalDropdown.js
2 parents c32c9d9 + 5dec7d4 commit 88b8412

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ Prop | Type | Optional | Default | Description
105105
`onDropdownWillShow`| func | Yes | | Trigger when dropdown will show by touching the button. **Return `false` can cancel the event.**
106106
`onDropdownWillHide`| func | Yes | | Trigger when dropdown will hide by touching the button. **Return `false` can cancel the event.**
107107
`onSelect` | func | Yes | | Trigger when option row touched with selected `index` and `value`. **Return `false` can cancel the event.**
108+
`accessible` | bool | Yes | true | Set accessibility of dropdown modal and dropdown rows
108109

109110
### Methods
110111
Method | Description

components/ModalDropdown.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default class ModalDropdown extends Component {
3333
defaultValue: PropTypes.string,
3434
options: PropTypes.array,
3535

36+
accessible: PropTypes.bool,
3637
animated: PropTypes.bool,
3738
showsVerticalScrollIndicator: PropTypes.bool,
3839

@@ -68,6 +69,7 @@ export default class ModalDropdown extends Component {
6869

6970
this.state = {
7071
disabled: props.disabled,
72+
accessible: props.accessible !== false,
7173
loading: props.options == null,
7274
showDropdown: false,
7375
buttonText: props.defaultValue,
@@ -150,6 +152,7 @@ export default class ModalDropdown extends Component {
150152
return (
151153
<TouchableOpacity ref={button => this._button = button}
152154
disabled={this.props.disabled}
155+
accessible={this.props.accessible}
153156
onPress={this._onButtonPress.bind(this)}>
154157
{
155158
this.props.children ||
@@ -182,7 +185,8 @@ export default class ModalDropdown extends Component {
182185
transparent={true}
183186
onRequestClose={this._onRequestClose.bind(this)}
184187
supportedOrientations={['portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right']}>
185-
<TouchableWithoutFeedback onPress={this._onModalPress.bind(this)}>
188+
<TouchableWithoutFeedback accessible={this.props.accessible}
189+
onPress={this._onModalPress.bind(this)}>
186190
<View style={styles.modal}>
187191
<View style={[styles.dropdown, this.props.dropdownStyle, frameStyle]}>
188192
{this.state.loading ? this._renderLoading() : this._renderDropdown()}
@@ -279,7 +283,8 @@ export default class ModalDropdown extends Component {
279283
this.props.renderRow(rowData, rowID, highlighted);
280284
let preservedProps = {
281285
key: key,
282-
onPress: () => this._onRowPress(rowData, sectionID, rowID, highlightRow)
286+
accessible: this.props.accessible,
287+
onPress: () => this._onRowPress(rowData, sectionID, rowID, highlightRow),
283288
};
284289
if (TOUCHABLE_ELEMENTS.find(name => name == row.type.displayName)) {
285290
var props = {...row.props};

0 commit comments

Comments
 (0)