PopupMenu under button

I’m using showAt for showing PopupMenu under the button.
Is there are way to get the same functionality with the showMenuAsync?

You can use Options::withTargetScreenArea or Options::withTargetComponent to specify the location of the popup menu.

Thanks, but with Options::withTargetComponent it will show up where the cursor is, not uniformly under the button, and for Options::withTargetScreenArea how to find a screen coordinate of my button?

Can you show the code you’re using? withTargetComponent should position the menu directly next to the target component.

You are right, withTargetComponent behave exactly like showAt.
Code I’m using:
m.showMenuAsync(juce::PopupMenu::Options().withTargetComponent(menuButton), juce::ModalCallbackFunction::forComponent(menuInvocationCallback, this));

I’m not sure why the behavior was different before.
Thank you