diff --git a/src/components/AddPaymentMethodMenu.js b/src/components/AddPaymentMethodMenu.js index 399247a35676..2c3af95a3fad 100644 --- a/src/components/AddPaymentMethodMenu.js +++ b/src/components/AddPaymentMethodMenu.js @@ -1,3 +1,4 @@ +import _ from 'underscore'; import React from 'react'; import PropTypes from 'prop-types'; import {withOnyx} from 'react-native-onyx'; @@ -24,6 +25,12 @@ const propTypes = { vertical: PropTypes.number, }), + /** Where the popover should be positioned relative to the anchor points. */ + anchorAlignment: PropTypes.shape({ + horizontal: PropTypes.oneOf(_.values(CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL)), + vertical: PropTypes.oneOf(_.values(CONST.MODAL.ANCHOR_ORIGIN_VERTICAL)), + }), + /** List of betas available to current user */ betas: PropTypes.arrayOf(PropTypes.string), @@ -35,6 +42,10 @@ const propTypes = { const defaultProps = { anchorPosition: {}, + anchorAlignment: { + horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT, + vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM, + }, betas: [], anchorRef: () => {}, }; @@ -45,6 +56,7 @@ function AddPaymentMethodMenu(props) { isVisible={props.isVisible} onClose={props.onClose} anchorPosition={props.anchorPosition} + anchorAlignment={props.anchorAlignment} anchorRef={props.anchorRef} onItemSelected={props.onClose} menuItems={[ diff --git a/src/components/ButtonWithDropdownMenu.js b/src/components/ButtonWithDropdownMenu.js index a0a6e276bc28..04bc3f6fb54a 100644 --- a/src/components/ButtonWithDropdownMenu.js +++ b/src/components/ButtonWithDropdownMenu.js @@ -143,6 +143,7 @@ function ButtonWithDropdownMenu(props) { ) : (