Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 33a031c

Browse files
MortimerGorobluemarvin
authored andcommitted
Do not show empty selection menu (#2216)
1 parent 2353c72 commit 33a031c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
import org.mozilla.vrbrowser.ui.widgets.prompts.ConfirmPromptWidget;
5858
import org.mozilla.vrbrowser.ui.widgets.prompts.PromptWidget;
5959
import org.mozilla.vrbrowser.ui.widgets.settings.SettingsWidget;
60+
import org.mozilla.vrbrowser.utils.StringUtils;
6061
import org.mozilla.vrbrowser.utils.SystemUtils;
6162
import org.mozilla.vrbrowser.utils.ViewUtils;
6263

@@ -1632,6 +1633,11 @@ public void onSecurityChange(GeckoSession geckoSession, SecurityInformation secu
16321633

16331634
@Override
16341635
public void onShowActionRequest(@NonNull GeckoSession aSession, @NonNull Selection aSelection, @NonNull String[] aActions, @NonNull GeckoResponse<String> aResponse) {
1636+
if (StringUtils.isEmpty(aSelection.text) || (aActions.length == 1 && GeckoSession.SelectionActionDelegate.ACTION_HIDE.equals(aActions[0]))) {
1637+
// See: https://github.com/MozillaReality/FirefoxReality/issues/2214
1638+
aResponse.respond(GeckoSession.SelectionActionDelegate.ACTION_HIDE);
1639+
return;
1640+
}
16351641
TelemetryWrapper.longPressContextMenuEvent();
16361642

16371643
hideContextMenus();

0 commit comments

Comments
 (0)