Skip to content

Commit

Permalink
Merge pull request #5753 from parasharrajat/kill-keyboard
Browse files Browse the repository at this point in the history
Close keyboard as soon as user scrolls the contacts list
  • Loading branch information
tgolen authored Oct 18, 2021
2 parents 2e57dee + 01ff0e3 commit 4916b3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/components/OptionsList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'underscore';
import React, {forwardRef, Component} from 'react';
import {View} from 'react-native';
import {Keyboard, View} from 'react-native';
import PropTypes from 'prop-types';
import styles from '../styles/styles';
import OptionRow from '../pages/home/sidebar/OptionRow';
Expand Down Expand Up @@ -234,6 +234,12 @@ class OptionsList extends Component {
ref={this.props.innerRef}
indicatorStyle="white"
keyboardShouldPersistTaps="always"

// Both `keyboardDismissMode` & `onScrollBeginDrag` props are needed to ensure that virtual keyboard is
// dismissed on all platforms.
// eslint-disable-next-line react/jsx-props-no-multi-spaces
keyboardDismissMode="on-drag"
onScrollBeginDrag={() => Keyboard.dismiss()}
contentContainerStyle={[...this.props.contentContainerStyles]}
showsVerticalScrollIndicator={false}
sections={this.props.sections}
Expand Down
1 change: 0 additions & 1 deletion src/pages/NewGroupPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ class NewGroupPage extends Component {
disableArrowKeysActions
hideAdditionalOptionStates
forceTextUnreadStyle
shouldFocusOnSelectRow
/>
</View>
{this.state.selectedOptions?.length > 0 && (
Expand Down

0 comments on commit 4916b3f

Please sign in to comment.