Skip to content

Commit

Permalink
Merge pull request #20655 from dostongulmatov/fix/#20262-send-money-p…
Browse files Browse the repository at this point in the history
…opover-position

fix send money - green payment button is visible bug
  • Loading branch information
arosiclair authored Jun 15, 2023
2 parents a8c202d + 07bdeb3 commit 9797fa4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/ButtonWithDropdownMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,23 @@ function ButtonWithDropdownMenu(props) {
const [popoverAnchorPosition, setPopoverAnchorPosition] = useState(null);
const {windowWidth, windowHeight} = useWindowDimensions();
const caretButton = useRef(null);
const selectedItem = props.options[selectedItemIndex];

useEffect(() => {
if (!caretButton.current) {
return;
}
if (!isMenuVisible) {
return;
}
caretButton.current.measureInWindow((x, y, w, h) => {
setPopoverAnchorPosition({
horizontal: x + w,
vertical: y + h,
});
});
}, [windowWidth, windowHeight]);
}, [windowWidth, windowHeight, isMenuVisible]);

const selectedItem = props.options[selectedItemIndex];
return (
<View>
{props.options.length > 1 ? (
Expand All @@ -87,9 +91,7 @@ function ButtonWithDropdownMenu(props) {
success
isDisabled={props.isDisabled}
style={[styles.pl0]}
onPress={() => {
setIsMenuVisible(true);
}}
onPress={() => setIsMenuVisible(true)}
shouldRemoveLeftBorderRadius
>
<Icon
Expand Down

0 comments on commit 9797fa4

Please sign in to comment.