Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix #1522: Context menu interfering with text selection menu. #1523
Conversation
| if (targetLink) { | ||
| data.link = targetLink.href; | ||
| data.title = targetLink.textContent; |
This comment has been minimized.
This comment has been minimized.
|
|
||
| if (!targetLink && !targetImage) { | ||
| // No link or image was tapped, sending empty callback so the ContextMenu will know that it | ||
| // should not show the menu(only text selection menu if applicable). | ||
| webkit.messageHandlers.contextMenuMessageHandler.postMessage(data); |
This comment has been minimized.
This comment has been minimized.
| @@ -503,10 +503,6 @@ class Tab: NSObject { | |||
| guard let url = self.webView?.url else { | |||
| return | |||
| } | |||
|
|
|||
| if let helper = contentScriptManager.getContentScript(ContextMenuHelper.name()) as? ContextMenuHelper { | |||
| helper.replaceWebViewLongPress() | |||
This comment has been minimized.
This comment has been minimized.
| @@ -126,6 +125,9 @@ extension ContextMenuHelper: TabContentScript { | |||
| guard let data = message.body as? [String: AnyObject] else { | |||
| return | |||
| } | |||
|
|
|||
| // No image or link was pressed, we are clearing `elements` so no accidental link tap occurs. | |||
| if data.isEmpty { elements = nil } | |||
This comment has been minimized.
This comment has been minimized.
iccub
Sep 10, 2019
Author
Contributor
the context menu javascript trigger on regular taps too, so if you swipe and touch an image/link by accident, elements was assigned and caused a bug when context menu was showing even if you didn't tap on a link
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
iccub commentedSep 10, 2019
•
edited
Summary of Changes
This pull request fixes issue #1522
Submitter Checklist:
NSLocalizableString()Test Plan:
Screenshots:
Reviewer Checklist:
QA/(Yes|No)release-notes/(include|exclude)bug/enhancement