Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ npx babel-node scripts/compile.js
| `verboseLoggingFunction` | Same as loggingFunction but also provides strategy used to determine failed search | boolean | false |
| `filterFunctions` | Array of functions that are used to limit which emojis should be rendered. Each of this function will be invoked with single parameter being `emoji` data and if every function returns `true` for `emoji` then this emoji will be included and displayed.| Array(function) | [] |
| `renderAheadOffset` | Specify how many pixels in advance you want views to be rendered. Increasing this value can help reduce blanks (if any). However, making this low can improve performance if you're having issues with it (see [#36](https://github.com/sskhandek/react-native-emoji-input/issues/36)). Higher values also increase re-render compute | number | 1500 |
| `keyboardShouldPersistTaps` | Determines when the keyboard should stay visible after a tap. Useful when you want to prevent the keyboard from getting dismissed on emoji selection. [More about this props.](https://reactnative.dev/docs/scrollview#keyboardshouldpersisttaps) | enum('always', 'never', 'handled') | 'always' |
> \* When the search function yields this function is called. Additionally when the user clears the query box this function is called with the previous longest query since the last time the query box was empty. By default the function is called with one parameter, a string representing the query. If the verbose logging function parameter is set to true the function is called with a second parameter that is a string specifying why the function was called (either 'emptySearchResult' or 'longestPreviousQuery').

## Usage
Expand Down
9 changes: 6 additions & 3 deletions src/EmojiInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ class EmojiInput extends React.PureComponent {

render() {
const { selectedEmoji, offsetY } = this.state;
const { enableSearch, width, renderAheadOffset } = this.props;
const { enableSearch, width, renderAheadOffset, keyboardShouldPersistTaps } = this.props;
return (
<View
style={{
Expand Down Expand Up @@ -510,6 +510,7 @@ class EmojiInput extends React.PureComponent {
rowRenderer={this._rowRenderer}
ref={component => (this._recyclerListView = component)}
onScroll={this.handleScroll}
keyboardShouldPersistTaps={keyboardShouldPersistTaps}
/>
{!this.state.searchQuery &&
this.props.showCategoryTab && (
Expand Down Expand Up @@ -639,7 +640,8 @@ EmojiInput.defaultProps = {
categoryFontSize: 20,
resetSearch: false,
filterFunctions: [],
renderAheadOffset: 1500
renderAheadOffset: 1500,
keyboardShouldPersistTaps: 'always'
};

EmojiInput.propTypes = {
Expand All @@ -665,7 +667,8 @@ EmojiInput.propTypes = {
defaultFrequentlyUsedEmoji: PropTypes.arrayOf(PropTypes.string),
resetSearch: PropTypes.bool,
filterFunctions: PropTypes.arrayOf(PropTypes.func),
renderAheadOffset: PropTypes.number
renderAheadOffset: PropTypes.number,
keyboardShouldPersistTaps: PropTypes.oneOf(['always', 'never', 'handled'])
};

const styles = {
Expand Down