Skip to content

Commit

Permalink
Check if selection action is available before executing it. (#2317)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro authored and bluemarvin committed Nov 19, 2019
1 parent ff64d29 commit 8cb8529
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -1649,13 +1649,17 @@ public void onShowActionRequest(@NonNull GeckoSession aSession, @NonNull Selecti
@Override
public void onAction(String action) {
hideContextMenus();
aSelection.execute(action);
if (aSelection.isActionAvailable(action)) {
aSelection.execute(action);
}
}

@Override
public void onDismiss() {
hideContextMenus();
aSelection.execute(GeckoSession.SelectionActionDelegate.ACTION_UNSELECT);
if (aSelection.isActionAvailable(GeckoSession.SelectionActionDelegate.ACTION_UNSELECT)) {
aSelection.execute(GeckoSession.SelectionActionDelegate.ACTION_UNSELECT);
}
}
});
mSelectionMenu.show(KEEP_FOCUS);
Expand Down

0 comments on commit 8cb8529

Please sign in to comment.