Skip to content
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

Standardize arrow navigation in OptionsLists #7702

Merged
merged 132 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
e47da89
Remove unnecessary arrow function
roryabraham Feb 10, 2022
ad207d8
Fix arrow key navigation for new chat and new group pages
roryabraham Feb 10, 2022
a8788b9
Fix arrow key navigation on IOUParticipantsPage
roryabraham Feb 10, 2022
3ea199f
Clean up SettlementButton onPress
roryabraham Feb 10, 2022
203d9ef
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Feb 10, 2022
770ae54
Get naive working implementation in IOUConfirmationList
roryabraham Feb 12, 2022
46a4a20
Implement flattenSections in O(n) instead of O(n^2)
roryabraham Feb 12, 2022
40dd812
Ditch the deprecated KeyboardEvent.keyCode
roryabraham Feb 12, 2022
2f1f1b8
Use KeyboardShortcuts lib instead of onKeyPress for OptionsSelector
roryabraham Feb 12, 2022
91c813e
Move keyboard event shim to platformSetup
roryabraham Feb 14, 2022
e4ae1a5
Deprecate disableArrowKeysActions
roryabraham Feb 14, 2022
c89e442
Create withArrowKeyListTraversal HOC
roryabraham Feb 14, 2022
851a8f0
Pass focusedIndex to wrapped component
roryabraham Feb 14, 2022
d2d5a50
Convert HOC to regular component
roryabraham Feb 14, 2022
86a4d48
Implement ArrowKeyFocusManager in OptionsSelector
roryabraham Feb 14, 2022
2d7ed4e
Implement integerPropType and allow key events to bubble
roryabraham Feb 15, 2022
5225c33
Implement ArrowKeyFocusManager in IOUConfirmationList
roryabraham Feb 15, 2022
a3c4730
Fix off-by-one error in NewGroupPage and don't show selected options …
roryabraham Feb 15, 2022
8e9aef4
Optimize allOptions computation in OptionsSelector
roryabraham Feb 15, 2022
1f6a301
Fix JS style
roryabraham Feb 15, 2022
410b0f8
Cleanup and optimize IOUConfirmationList
roryabraham Feb 15, 2022
b12e61e
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Feb 15, 2022
d0882bb
Get rid of unnecessary arrow function in render
roryabraham Feb 15, 2022
65de321
Make enter key create new group if search bar is focused
roryabraham Feb 15, 2022
6e9efea
Don't scroll to top if we can't select multiple options
roryabraham Feb 15, 2022
b738d4e
Make CMD+Enter create a group
roryabraham Feb 16, 2022
c731eff
Fix KeyboardEvent unsubscribe
roryabraham Feb 16, 2022
6933b0e
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Feb 18, 2022
437575a
Fix indexOffset on IOUParticipantsRequest and IOUParticipantsSplit
roryabraham Feb 18, 2022
c28e99c
Move some translations to common
roryabraham Feb 19, 2022
2a845f1
Rename events to eventHandlers in KeyboardShortcut lib
roryabraham Feb 19, 2022
2624935
Update KeyboardShortcut lib to map callbacks by key+modifier combo
roryabraham Feb 19, 2022
81cb74b
(draft state) move group selection confirm button into OptionsSelector
roryabraham Feb 19, 2022
4b7fc98
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Feb 23, 2022
5a8eba7
Move allOptions to state
roryabraham Feb 24, 2022
318a161
Fix shift key modifier
roryabraham Feb 24, 2022
c9d7797
Make CMD+Enter work for New Chat page
roryabraham Feb 24, 2022
bac85e5
Make CMD+Enter work for IOUConfirmationList
roryabraham Feb 24, 2022
5f9b731
Make CMD+Enter work for WorkspaceInvitePage
roryabraham Feb 24, 2022
72cd111
Fix JS style
roryabraham Feb 24, 2022
7ced82a
Move count to the end of maxParticipantsReached UI string
roryabraham Feb 24, 2022
e0a106d
Get rid of NumberUtils library
roryabraham Feb 24, 2022
42dbb04
Rename maybeToggleIndex to maybeToggleParticipant
roryabraham Feb 25, 2022
12742f8
Make enter key confirm IOU if there's only one participant
roryabraham Feb 25, 2022
da17bce
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Mar 2, 2022
12efe8f
Fix scrolling to first item in second section
roryabraham Mar 2, 2022
a2d4917
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Mar 2, 2022
a7d246e
Fix bad merge
roryabraham Mar 2, 2022
19afbfa
Fix PropTypes comments
roryabraham Mar 2, 2022
33f1f69
Use reject instead of filter
roryabraham Mar 2, 2022
93e7c5a
Improve comment in KeyboardShortcut module
roryabraham Mar 2, 2022
d0db2f9
Remove unused variable
roryabraham Mar 2, 2022
297d675
Remove unnecessary fragment
roryabraham Mar 2, 2022
ba2a9ac
Fix bad merge (again)
roryabraham Mar 2, 2022
8fa9378
Another key priority comment
roryabraham Mar 2, 2022
944d657
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Mar 25, 2022
9643c4e
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Apr 6, 2022
dd1ed1a
Remove unused state field
roryabraham Apr 6, 2022
86b7b73
Remove hack to adjust item index
roryabraham Apr 6, 2022
0d15439
Fix JS style
roryabraham Apr 6, 2022
61d757f
Get rid of deprecated getShortcutModifiers
roryabraham Apr 7, 2022
3b70fb0
Require shortcut modifiers to be an array
roryabraham Apr 7, 2022
4e13c02
Disable deselection of IOU participants if split initiated in global …
roryabraham Apr 7, 2022
fa8d3fc
Rename canDeselectParticipants to canModifyParticipants
roryabraham Apr 7, 2022
874265d
Do not allow splits with yourself
roryabraham Apr 7, 2022
07ba516
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Apr 11, 2022
301f3ae
Add keyboard shortcut for CTRL_ENTER
roryabraham Apr 11, 2022
8ec2a5e
Adjust focus when list items change
roryabraham Apr 11, 2022
1c7cdaa
Fix JS crash
roryabraham Apr 13, 2022
01ae6e0
Fix auto-focus jank
roryabraham Apr 13, 2022
baea43e
auto-scroll to first unselected option
roryabraham Apr 13, 2022
908b18e
Get rid of PropTypeUtils
roryabraham Apr 14, 2022
57d9f75
Remove unused getFocusedIndex
roryabraham Apr 14, 2022
51faacf
Cleanup setState style
roryabraham Apr 14, 2022
8ef6923
simplify shouldEnterKeyEventBubble
roryabraham Apr 14, 2022
4c06345
Get rid of unrelated SettlementButton changes
roryabraham Apr 14, 2022
21545f7
Remove redundant comment
roryabraham Apr 14, 2022
90941d6
Use reduce instead of groupBy
roryabraham Apr 14, 2022
0a7f4a3
Simplify callbacks in NewChatPage
roryabraham Apr 15, 2022
132c824
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Apr 15, 2022
2ad0ee3
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Apr 18, 2022
a3845b4
Make ArrowKeyFocusManager fully managed
roryabraham Apr 18, 2022
d002b0a
Simplify rendering children in ArrowKeyFocusManager
roryabraham Apr 18, 2022
d63a5ba
Fix JS style
roryabraham Apr 18, 2022
2dfae82
Extract enter key config from ArrowKeyFocusManager
roryabraham Apr 18, 2022
27e1900
Save draft state
roryabraham Apr 20, 2022
65b3e7a
Merge branch 'main' into Rory-CombineIOUConfirmationListAndOptionsSel…
roryabraham May 5, 2022
64672b1
Fix lastActorDetails JS crash
roryabraham May 5, 2022
2643e27
Fix IOUSelectionList footer style
roryabraham May 5, 2022
41b15c4
Add disableArrowKeyActions back for unmodifiable participants lists
roryabraham May 5, 2022
f3177cc
DRY up enter keyboard shortcut
roryabraham May 5, 2022
e28b109
Remove unused updateFocusedIndex member function
roryabraham May 5, 2022
03813cf
Remove unused allOptions and scrollToIndex
roryabraham May 5, 2022
211e1d2
DRY up CTRLEnter shortcut
roryabraham May 5, 2022
adf1241
Remove unnecessary componentWillUnmount
roryabraham May 5, 2022
0f42e59
DRY up text input delayed focus
roryabraham May 5, 2022
ba6802b
Simplify diff
roryabraham May 5, 2022
82216ad
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham May 6, 2022
7c82064
Move flattenSections out of OptionsListUtils and into OptionsSelector…
roryabraham May 6, 2022
6796e1b
Update focusManager code'
roryabraham May 6, 2022
7063fc2
Put allOptions back in state, clean up componentDidUpdate
roryabraham May 6, 2022
55d73b6
Fix shouldShowOptions
roryabraham May 6, 2022
48746c8
Fix text input style when under OptionsList
roryabraham May 6, 2022
ebb94d7
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham May 26, 2022
64692f7
Make onFocusedIndexChanged required
roryabraham May 26, 2022
3c978bd
Fix bad merge
roryabraham May 26, 2022
138ac7a
Focus the next best result when an option is selected
roryabraham May 26, 2022
527bad4
Fix missing button on 1:1 request confirmation page
roryabraham May 26, 2022
896649e
DRY up and simplify IOUCurrencySelection
roryabraham May 26, 2022
c53ada3
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham May 31, 2022
8c5e6de
Dont execute callback until after determininig shouldBubble
roryabraham May 31, 2022
a658b0b
Implement getItemLayout to fix navigation on long lists
roryabraham Jun 1, 2022
993c910
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Jun 1, 2022
773602e
Address low-hanging fruit
roryabraham Jun 2, 2022
10d8d5e
Get rid of unnecessary changes to state in IOUConfirmationList
roryabraham Jun 2, 2022
b01d1ac
Add back local isLoading variable
roryabraham Jun 2, 2022
71d3e43
Fix getItemLayout
roryabraham Jun 3, 2022
5f149ef
Add an implementation note about headers and footers
roryabraham Jun 3, 2022
337b365
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Jun 3, 2022
4336e8c
Improve brittle comment
roryabraham Jun 3, 2022
f53ecc0
Merge branch main into Rory-SearchResultsArrowNavigation
roryabraham Jun 10, 2022
fa322c6
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Jun 11, 2022
1a3c15c
Revert unneeded change in OptionsList
roryabraham Jun 11, 2022
0a187fd
Fix newFocusedIndex
roryabraham Jun 11, 2022
1510dcd
Merge branch 'main' into Rory-SearchResultsArrowNavigation
roryabraham Jun 20, 2022
066b0a5
Implement https://github.com/Expensify/App/pull/9404 in new location
roryabraham Jun 20, 2022
93bc317
Clean up getItemLayout JSDoc
roryabraham Jun 23, 2022
1ddb135
Rename variables and improve comments in getItemLayout`
roryabraham Jun 23, 2022
f1bfcf8
Use memoization and build flat data array
roryabraham Jun 24, 2022
4bd7bfd
Remove unnecessary onScrollToIndexFailed
roryabraham Jun 24, 2022
9996b46
Fix deletion crash
roryabraham Jun 24, 2022
c9cf004
Get rid of restructuring alias
roryabraham Jun 24, 2022
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
15 changes: 15 additions & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,26 @@ const CONST = {
shortcutKey: 'Enter',
modifiers: [],
},
CTRL_ENTER: {
descriptionKey: null,
shortcutKey: 'Enter',
modifiers: ['CTRL'],
},
COPY: {
descriptionKey: 'copy',
shortcutKey: 'C',
modifiers: ['CTRL'],
},
ARROW_UP: {
descriptionKey: null,
shortcutKey: 'ArrowUp',
modifiers: [],
},
ARROW_DOWN: {
descriptionKey: null,
marcaaron marked this conversation as resolved.
Show resolved Hide resolved
shortcutKey: 'ArrowDown',
modifiers: [],
},
},
KEYBOARD_SHORTCUT_KEY_DISPLAY_NAME: {
CONTROL: 'CTRL',
Expand Down
76 changes: 76 additions & 0 deletions src/components/ArrowKeyFocusManager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import {Component} from 'react';
import PropTypes from 'prop-types';
import CONST from '../CONST';
import KeyboardShortcut from '../libs/KeyboardShortcut';

const propTypes = {
/** Children to render. */
children: PropTypes.oneOfType([
PropTypes.func,
PropTypes.node,
]).isRequired,
roryabraham marked this conversation as resolved.
Show resolved Hide resolved

/** The current focused index. */
focusedIndex: PropTypes.number.isRequired,

/** The maximum index – provided so that the focus can be sent back to the beginning of the list when the end is reached. */
maxIndex: PropTypes.number.isRequired,

/** A callback executed when the focused input changes. */
onFocusedIndexChanged: PropTypes.func.isRequired,
};

class ArrowKeyFocusManager extends Component {
roryabraham marked this conversation as resolved.
Show resolved Hide resolved
componentDidMount() {
const arrowUpConfig = CONST.KEYBOARD_SHORTCUTS.ARROW_UP;
const arrowDownConfig = CONST.KEYBOARD_SHORTCUTS.ARROW_DOWN;

this.unsubscribeArrowUpKey = KeyboardShortcut.subscribe(arrowUpConfig.shortcutKey, () => {
if (this.props.maxIndex <= 1) {
return;
}

let newFocusedIndex = this.props.focusedIndex - 1;

// Wrap around to the bottom of the list
if (newFocusedIndex < 0) {
newFocusedIndex = this.props.maxIndex;
}

this.props.onFocusedIndexChanged(newFocusedIndex);
}, arrowUpConfig.descriptionKey, arrowUpConfig.modifiers, true);

this.unsubscribeArrowDownKey = KeyboardShortcut.subscribe(arrowDownConfig.shortcutKey, () => {
Julesssss marked this conversation as resolved.
Show resolved Hide resolved
if (this.props.maxIndex <= 1) {
return;
}

let newFocusedIndex = this.props.focusedIndex + 1;

// Wrap around to the top of the list
if (newFocusedIndex > this.props.maxIndex) {
newFocusedIndex = 0;
}

this.props.onFocusedIndexChanged(newFocusedIndex);
}, arrowDownConfig.descriptionKey, arrowDownConfig.modifiers, true);
}

componentWillUnmount() {
if (this.unsubscribeArrowUpKey) {
this.unsubscribeArrowUpKey();
}

if (this.unsubscribeArrowDownKey) {
this.unsubscribeArrowDownKey();
}
}

render() {
return this.props.children;
}
}

ArrowKeyFocusManager.propTypes = propTypes;

export default ArrowKeyFocusManager;
132 changes: 56 additions & 76 deletions src/components/IOUConfirmationList.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import React, {Component} from 'react';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
import styles from '../styles/styles';
import Text from './Text';
import themeColors from '../styles/themes/default';
import * as OptionsListUtils from '../libs/OptionsListUtils';
import OptionsList from './OptionsList';
import OptionsSelector from './OptionsSelector';
import ONYXKEYS from '../ONYXKEYS';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions';
import compose from '../libs/compose';
import FixedFooter from './FixedFooter';
import TextInput from './TextInput';
import CONST from '../CONST';
import ButtonWithMenu from './ButtonWithMenu';
import Log from '../libs/Log';
Expand All @@ -26,10 +21,10 @@ const propTypes = {
/** Callback to inform parent modal of success */
onConfirm: PropTypes.func.isRequired,

/** Callback to to parent modal to send money */
/** Callback to parent modal to send money */
onSendMoney: PropTypes.func.isRequired,

// Callback to update comment from IOUModal
/** Callback to update comment from IOUModal */
onUpdateComment: PropTypes.func,

/** Comment value from IOUModal */
Expand All @@ -44,7 +39,7 @@ const propTypes = {
/** IOU type */
iouType: PropTypes.string,

// Selected participants from IOUModal with login
/** Selected participants from IOUModal with login */
roryabraham marked this conversation as resolved.
Show resolved Hide resolved
participants: PropTypes.arrayOf(PropTypes.shape({
login: PropTypes.string.isRequired,
alternateText: PropTypes.string,
Expand Down Expand Up @@ -135,26 +130,7 @@ class IOUConfirmationList extends Component {
};

this.toggleOption = this.toggleOption.bind(this);
this.onPress = this.onPress.bind(this);
}

componentDidMount() {
// We need to wait for the transition animation to end before focusing the TextInput,
// otherwise the TextInput isn't animated correctly
setTimeout(() => this.textInput.focus(), CONST.ANIMATED_TRANSITION);
roryabraham marked this conversation as resolved.
Show resolved Hide resolved
}

/**
* @param {String} value
*/
onPress(value) {
if (this.props.iouType === CONST.IOU.IOU_TYPE.SEND) {
Log.info(`[IOU] Sending money via: ${value}`);
this.props.onSendMoney(value);
} else {
Log.info(`[IOU] Requesting money via: ${value}`);
this.props.onConfirm(this.getSplits());
}
this.confirm = this.confirm.bind(this);
}

/**
Expand Down Expand Up @@ -190,6 +166,7 @@ class IOUConfirmationList extends Component {

/**
* Returns the participants without amount
*
* @param {Array} participants
* @returns {Array}
*/
Expand All @@ -199,7 +176,7 @@ class IOUConfirmationList extends Component {

/**
* Returns the sections needed for the OptionsSelector
* @param {Boolean} maxParticipantsReached
*
* @returns {Array}
*/
getSections() {
Expand All @@ -210,6 +187,7 @@ class IOUConfirmationList extends Component {

const formattedSelectedParticipants = this.getParticipantsWithAmount(selectedParticipants);
const formattedUnselectedParticipants = this.getParticipantsWithoutAmount(unselectedParticipants);
const formattedParticipants = _.union(formattedSelectedParticipants, formattedUnselectedParticipants);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there an issue when just using the formattedSelectedParticipants participants? What is the union for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't really a problem, just a quirky implementation where we had:

  1. A section titled Who was there with all the selected participants that would always show
  2. A section without a title with all the unselected participants that would only show if there were any unselected participants.

The effect for the user appeared to be a single section titled Who was there with all the selected participants followed by any unselected participants. That's exactly what we're doing here – makes the code a bit more in-line with what the user sees.

Overall this change probably wasn't necessary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, so we can revert it?


const formattedMyPersonalDetails = OptionsListUtils.getIOUConfirmationOptionsFromMyPersonalDetail(
this.props.myPersonalDetails,
Expand All @@ -227,14 +205,9 @@ class IOUConfirmationList extends Component {
isDisabled: true,
}, {
title: this.props.translate('iOUConfirmationList.whoWasThere'),
data: formattedSelectedParticipants,
data: formattedParticipants,
shouldShow: true,
indexOffset: 0,
}, {
title: undefined,
data: formattedUnselectedParticipants,
shouldShow: !_.isEmpty(formattedUnselectedParticipants),
indexOffset: 0,
indexOffset: 1,
});
} else {
const formattedParticipants = OptionsListUtils.getIOUConfirmationOptionsFromParticipants(this.props.participants,
Expand Down Expand Up @@ -342,52 +315,60 @@ class IOUConfirmationList extends Component {
});
}

/**
* @param {String} paymentMethod
*/
confirm(paymentMethod) {
const selectedParticipants = this.getSelectedParticipants();
if (_.isEmpty(selectedParticipants)) {
return;
}

if (this.props.iouType === CONST.IOU.IOU_TYPE.SEND) {
if (!paymentMethod) {
return;
}

Log.info(`[IOU] Sending money via: ${paymentMethod}`);
this.props.onSendMoney(paymentMethod);
} else {
this.props.onConfirm(this.getSplits());
}
}

render() {
const hoverStyle = this.props.hasMultipleParticipants ? styles.hoveredComponentBG : {};
const toggleOption = this.props.hasMultipleParticipants ? this.toggleOption : undefined;
const selectedParticipants = this.getSelectedParticipants();
const shouldShowSettlementButton = this.props.iouType === CONST.IOU.IOU_TYPE.SEND;
const shouldDisableButton = selectedParticipants.length === 0 || this.props.network.isOffline;
const isLoading = this.props.iou.loading && !this.props.network.isOffline;
const recipient = this.state.participants[0];
const canModifyParticipants = this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants;
return (
<>
<View style={[styles.flexGrow0, styles.flexShrink1, styles.flexBasisAuto, styles.w100, styles.flexRow]}>
<OptionsList
sections={this.getSections()}
disableArrowKeysActions
disableFocusOptions
hideAdditionalOptionStates
forceTextUnreadStyle
canSelectMultipleOptions={this.props.hasMultipleParticipants}
selectedOptions={this.getSelectedOptions()}
onSelectRow={toggleOption}
isDisabled={!canModifyParticipants}
optionHoveredStyle={hoverStyle}
/>
</View>
<View style={[styles.ph5, styles.pv5, styles.flexGrow1, styles.flexShrink0, styles.iouConfirmComment]}>
<TextInput
ref={el => this.textInput = el}
label={this.props.translate('iOUConfirmationList.whatsItFor')}
value={this.props.comment}
onChangeText={this.props.onUpdateComment}
placeholder={this.props.translate('common.optional')}
placeholderTextColor={themeColors.placeholderText}
/>
</View>
<FixedFooter>
{this.props.network.isOffline && (
<Text style={[styles.formError, styles.pb2]}>
{this.props.translate('session.offlineMessage')}
</Text>
)}
{shouldShowSettlementButton ? (
<OptionsSelector
sections={this.getSections()}
value={this.props.comment}
onSelectRow={canModifyParticipants ? this.toggleOption : undefined}
onConfirmSelection={this.confirm}
onChangeText={this.props.onUpdateComment}
textInputLabel={this.props.translate('iOUConfirmationList.whatsItFor')}
placeholderText={this.props.translate('common.optional')}
selectedOptions={this.getSelectedOptions()}
canSelectMultipleOptions={this.props.hasMultipleParticipants}
disableArrowKeysActions={!canModifyParticipants}
isDisabled={!canModifyParticipants}
hideAdditionalOptionStates
forceTextUnreadStyle
autoFocus
shouldDelayFocus
shouldTextInputAppearBelowOptions
shouldShowOfflineMessage
optionHoveredStyle={canModifyParticipants ? styles.hoveredComponentBG : {}}
footerContent={shouldShowSettlementButton
? (
<SettlementButton
isDisabled={shouldDisableButton}
isLoading={this.props.iou.loading && !this.props.network.isOffline}
onPress={this.onPress}
isLoading={isLoading}
onPress={this.confirm}
shouldShowPaypal={Boolean(recipient.payPalMeAddress)}
recipientPhoneNumber={recipient.phoneNumber}
enablePaymentsRoute={ROUTES.IOU_SEND_ENABLE_PAYMENTS}
Expand All @@ -399,12 +380,11 @@ class IOUConfirmationList extends Component {
<ButtonWithMenu
isDisabled={shouldDisableButton}
isLoading={isLoading}
onPress={(_event, value) => this.onPress(value)}
onPress={(_event, value) => this.confirm(value)}
options={this.splitOrRequestOptions}
/>
)}
</FixedFooter>
</>
/>
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/OptionRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ const OptionRow = (props) => {
styles.chatLinkRowPressable,
styles.flexGrow1,
styles.optionItemAvatarNameWrapper,
styles.sidebarInnerRowSmall,
styles.optionRowCompact,
styles.justifyContentCenter,
] : [
styles.chatLinkRowPressable,
styles.flexGrow1,
styles.optionItemAvatarNameWrapper,
styles.sidebarInnerRow,
styles.optionRow,
styles.justifyContentCenter,
]);
const hoveredBackgroundColor = props.hoverStyle && props.hoverStyle.backgroundColor
Expand Down
Loading