Skip to content

Commit

Permalink
Merge pull request #19354 from Expensify/OSBotify-cherry-pick-staging…
Browse files Browse the repository at this point in the history
…-19339

🍒 Cherry pick PR #19339 to staging 🍒
  • Loading branch information
OSBotify authored May 20, 2023
2 parents c2a5888 + 1751961 commit a4834ad
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001031605
versionName "1.3.16-5"
versionCode 1001031606
versionName "1.3.16-6"
}

splits {
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.16.5</string>
<string>1.3.16.6</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.16.5</string>
<string>1.3.16.6</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.3.16-5",
"version": "1.3.16-6",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down
13 changes: 10 additions & 3 deletions src/components/PopoverMenu/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'underscore';
import React from 'react';
import React, {useState} from 'react';
import PropTypes from 'prop-types';
import {View} from 'react-native';
import PopoverWithMeasuredContent from '../PopoverWithMeasuredContent';
Expand Down Expand Up @@ -40,11 +40,12 @@ const defaultProps = {

const PopoverMenu = (props) => {
const {isSmallScreenWidth} = useWindowDimensions();
const [selectedItemIndex, setSelectedItemIndex] = useState(null);

const selectItem = (index) => {
const selectedItem = props.menuItems[index];
props.onItemSelected(selectedItem);
selectedItem.onSelected();
setSelectedItemIndex(index);
};

const [focusedIndex, setFocusedIndex] = useArrowKeyFocusManager({initialFocusedIndex: -1, maxIndex: props.menuItems.length - 1});
Expand All @@ -66,7 +67,13 @@ const PopoverMenu = (props) => {
anchorAlignment={props.anchorOrigin}
onClose={props.onClose}
isVisible={props.isVisible}
onModalHide={() => setFocusedIndex(-1)}
onModalHide={() => {
setFocusedIndex(-1);
if (selectedItemIndex !== null) {
props.menuItems[selectedItemIndex].onSelected();
setSelectedItemIndex(null);
}
}}
animationIn={props.animationIn}
animationOut={props.animationOut}
animationInTiming={props.animationInTiming}
Expand Down

0 comments on commit a4834ad

Please sign in to comment.