Fix eventInWidget exceptions on textNodes#3019
Closed
vincentwoo wants to merge 1 commit intocodemirror:masterfrom
Closed
Fix eventInWidget exceptions on textNodes#3019vincentwoo wants to merge 1 commit intocodemirror:masterfrom
eventInWidget exceptions on textNodes#3019vincentwoo wants to merge 1 commit intocodemirror:masterfrom
Conversation
marijnh
added a commit
that referenced
this pull request
Jan 5, 2015
Member
|
I've pushed a slightly different patch (0cb74f8) to take care of this. I was under the impression that event targets always were real nodes, but I guess that's not the case. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue:
eventInWidgetis sometimes passed events that have as their target a text node. These nodes do not supportgetAttribute, at least in Chrome. I think Firefox is okay.Duplication:
Go to http://codemirror.net/demo/markselection.html (in Chrome), open the console, and then right click on the yellow highlighted text. An uncaught exception should fire.
Patch:
Check for the existence of
getAttributebefore trying to call it. Also, explicitly returnfalseat end of function (this is just a stylistic change for clarity).Hopefully this is the correct, intended behavior. Thanks again for your hard work on CodeMirror. I saw your tweet about not responding to patch requests too quickly to engender additional participation, so I figured I'd try to fix this one myself.