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

Commit

Permalink
Do not show empty selection menu (#2216)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro authored and bluemarvin committed Nov 8, 2019
1 parent 2353c72 commit 33a031c
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import org.mozilla.vrbrowser.ui.widgets.prompts.ConfirmPromptWidget;
import org.mozilla.vrbrowser.ui.widgets.prompts.PromptWidget;
import org.mozilla.vrbrowser.ui.widgets.settings.SettingsWidget;
import org.mozilla.vrbrowser.utils.StringUtils;
import org.mozilla.vrbrowser.utils.SystemUtils;
import org.mozilla.vrbrowser.utils.ViewUtils;

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

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

hideContextMenus();
Expand Down

0 comments on commit 33a031c

Please sign in to comment.