Repository navigation
Fix Search - Arrow navigation on search stops working #6272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
55cca0c
create index, index.native file for OptionsSelector
rushatgabhane 3bd9944
Merge main into fix-6131
rushatgabhane 888fe72
rm unnecessary prop keyboardDismissMode
rushatgabhane 9bcf199
dismiss keyboard for mWeb
rushatgabhane 0f81545
rm unnecessary comment
rushatgabhane ff2429a
fix code style
rushatgabhane 81abddb
Merge branch 'Expensify:main' into fix-6131
rushatgabhane 6704494
fix prop definitions
rushatgabhane eed26e7
import proptypes
rushatgabhane File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import React, {forwardRef} from 'react'; | ||
| import BaseOptionsList from './BaseOptionsList'; | ||
| import withWindowDimensions from '../withWindowDimensions'; | ||
| import {propTypes, defaultProps} from './optionsListPropTypes'; | ||
|
|
||
| const OptionsList = forwardRef((props, ref) => ( | ||
| <BaseOptionsList | ||
| // eslint-disable-next-line react/jsx-props-no-spreading | ||
| {...props} | ||
| ref={ref} | ||
| keyboardDismissMode={props.isSmallScreenWidth ? 'on-drag' : 'none'} | ||
| /> | ||
| )); | ||
|
|
||
| OptionsList.propTypes = propTypes; | ||
| OptionsList.defaultProps = defaultProps; | ||
| OptionsList.displayName = 'OptionsList'; | ||
|
|
||
| export default withWindowDimensions(OptionsList); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import React, {forwardRef} from 'react'; | ||
| import {Keyboard} from 'react-native'; | ||
| import BaseOptionsList from './BaseOptionsList'; | ||
| import {propTypes, defaultProps} from './optionsListPropTypes'; | ||
|
|
||
| const OptionsList = forwardRef((props, ref) => ( | ||
| <BaseOptionsList | ||
| // eslint-disable-next-line react/jsx-props-no-spreading | ||
| {...props} | ||
| ref={ref} | ||
| onScrollBeginDrag={() => Keyboard.dismiss()} | ||
| /> | ||
| )); | ||
|
|
||
| OptionsList.propTypes = propTypes; | ||
| OptionsList.defaultProps = defaultProps; | ||
| OptionsList.displayName = 'OptionsList'; | ||
|
|
||
| export default OptionsList; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| import PropTypes from 'prop-types'; | ||
| import SectionList from '../SectionList'; | ||
| import styles from '../../styles/styles'; | ||
| import optionPropTypes from '../optionPropTypes'; | ||
|
|
||
| const propTypes = { | ||
| /** option Background Color */ | ||
| optionBackgroundColor: PropTypes.string, | ||
|
|
||
| /** option flexStyle for the options list container */ | ||
| listContainerStyles: PropTypes.arrayOf(PropTypes.object), | ||
|
|
||
| /** Style for hovered state */ | ||
| // eslint-disable-next-line react/forbid-prop-types | ||
| optionHoveredStyle: PropTypes.object, | ||
|
|
||
| /** Extra styles for the section list container */ | ||
| contentContainerStyles: PropTypes.arrayOf(PropTypes.object), | ||
|
|
||
| /** Sections for the section list */ | ||
| sections: PropTypes.arrayOf(PropTypes.shape({ | ||
| /** Title of the section */ | ||
| title: PropTypes.string, | ||
|
|
||
| /** The initial index of this section given the total number of options in each section's data array */ | ||
| indexOffset: PropTypes.number, | ||
|
|
||
| /** Array of options */ | ||
| data: PropTypes.arrayOf(optionPropTypes), | ||
|
|
||
| /** Whether this section should show or not */ | ||
| shouldShow: PropTypes.bool, | ||
| })), | ||
|
|
||
| /** Index for option to focus on */ | ||
| focusedIndex: PropTypes.number, | ||
|
|
||
| /** Array of already selected options */ | ||
| selectedOptions: PropTypes.arrayOf(optionPropTypes), | ||
|
|
||
| /** Whether we can select multiple options or not */ | ||
| canSelectMultipleOptions: PropTypes.bool, | ||
|
|
||
| /** Whether to show headers above each section or not */ | ||
| hideSectionHeaders: PropTypes.bool, | ||
|
|
||
| /** Whether to allow option focus or not */ | ||
| disableFocusOptions: PropTypes.bool, | ||
|
|
||
| /** A flag to indicate whether to show additional optional states, such as pin and draft icons */ | ||
| hideAdditionalOptionStates: PropTypes.bool, | ||
|
|
||
| /** Force the text style to be the unread style on all rows */ | ||
| forceTextUnreadStyle: PropTypes.bool, | ||
|
|
||
| /** Callback to fire when a row is selected */ | ||
| onSelectRow: PropTypes.func, | ||
|
|
||
| /** Optional header message */ | ||
| headerMessage: PropTypes.string, | ||
|
|
||
| /** Passed via forwardRef so we can access the SectionList ref */ | ||
| innerRef: PropTypes.oneOfType([ | ||
| PropTypes.func, | ||
| PropTypes.shape({current: PropTypes.instanceOf(SectionList)}), | ||
| ]), | ||
|
|
||
| /** Whether to show the title tooltip */ | ||
| showTitleTooltip: PropTypes.bool, | ||
|
|
||
| /** Toggle between compact and default view of the option */ | ||
| optionMode: PropTypes.oneOf(['compact', 'default']), | ||
|
|
||
| /** Whether to disable the interactivity of the list's option row(s) */ | ||
| disableRowInteractivity: PropTypes.bool, | ||
|
|
||
| /** Callback to execute when the SectionList lays out */ | ||
| onLayout: PropTypes.func, | ||
| }; | ||
|
|
||
| const defaultProps = { | ||
| optionBackgroundColor: undefined, | ||
| optionHoveredStyle: undefined, | ||
| contentContainerStyles: [], | ||
| listContainerStyles: [styles.flex1], | ||
| sections: [], | ||
| focusedIndex: 0, | ||
| selectedOptions: [], | ||
| canSelectMultipleOptions: false, | ||
| hideSectionHeaders: false, | ||
| disableFocusOptions: false, | ||
| hideAdditionalOptionStates: false, | ||
| forceTextUnreadStyle: false, | ||
| onSelectRow: () => {}, | ||
| headerMessage: '', | ||
| innerRef: null, | ||
| showTitleTooltip: false, | ||
| optionMode: undefined, | ||
| disableRowInteractivity: false, | ||
| onLayout: undefined, | ||
| }; | ||
|
|
||
| export {propTypes, defaultProps}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.