mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-23 12:07:02 +08:00
Add a way to dismiss PopupMenu elements
Summary: In native Android apps, like the YouTube app, context menus are closed when the device orientation changes. In React Native apps instead, when having a [PopupMenu](https://developer.android.com/reference/android/widget/PopupMenu.html) open and rotating the device, the PopupMenu is not dismissed and appears in a wrong position on the screen. This PR exposes a `dismissPopupMenu` method to allow the application to dismiss any open PopupMenu: ```(javascript) UIManager.dismissPopupMenu() ``` Closes https://github.com/facebook/react-native/pull/15636 Differential Revision: D6837663 Pulled By: hramos fbshipit-source-id: 7b0f4f04341129ad45c703a50897e17d93651974
This commit is contained in:
committed by
Facebook Github Bot
parent
6426735e82
commit
353c070be9
@@ -802,6 +802,10 @@ public class UIImplementation {
|
||||
mOperationsQueue.enqueueShowPopupMenu(reactTag, items, error, success);
|
||||
}
|
||||
|
||||
public void dismissPopupMenu() {
|
||||
mOperationsQueue.enqueueDismissPopupMenu();
|
||||
}
|
||||
|
||||
public void sendAccessibilityEvent(int tag, int eventType) {
|
||||
mOperationsQueue.enqueueSendAccessibilityEvent(tag, eventType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user