Dont trigger element handler when it doesn't exist#130
Open
yringler wants to merge 1 commit intointercom:masterfrom
Open
Dont trigger element handler when it doesn't exist#130yringler wants to merge 1 commit intointercom:masterfrom
yringler wants to merge 1 commit intointercom:masterfrom
Conversation
Member
|
@yringler, thanks. Can you say more about what this is protecting against? When does the href-to document handler picks up and reacts to a click event when it shouldn't? Perhaps you could add a test? |
Author
|
It's picking up a click on a component which extends the ember linkto component. I don't have time to look into it further, unfortunately. For now we're just using my fork (I love yarn (which supports specifying a github url/branch!). |
Author
|
ember-href-to/addon/href-to.js Line 58 in 36c2fa8 I'll either switch our code to using link component directly, or update the PR Edit: when I click on a link-to, by the time the handler is running the link to doesn't exist anymore (navigation already happened), and the check this.applicationInstance.lookup('-view-registry:main')[id] returns undefined.
|
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.
In our project, sometimes navigation would end up where we didn't expect.
It turns out that sometimes the href-to document handler picks up and reacts to a click event when it shouldn't.
Testing that the element being responded to still exists in the DOM fixed it for us.