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

Do not show empty selection menu #2216

Merged
merged 1 commit into from
Nov 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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