-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Sidebar navigations being cancelled. #6590
Conversation
this.close_(); | ||
const tgtLoc = parseUrl(target.href); | ||
const curLoc = parseUrl(this.getAmpDoc().win.location.href); | ||
const tgtHref = `${tgtLoc.origin}${tgtLoc.pathname}${tgtLoc.search}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead compare removeFragment(a.href) == removeFragment(b.href)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Should i keep the check for tgt.hash
still or just close if the navigation is not to a new page? I think it's not entirely needed but a bit safer and we can relax it moving forward.
@@ -282,11 +282,91 @@ describe('amp-sidebar', () => { | |||
}); | |||
}); | |||
|
|||
it('should reflect state of the sidebar', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why github thinks I added this 😩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the git diff just messed up
Added tests PTAL 👀 |
}, | ||
}; | ||
}); | ||
anchor.dispatchEvent ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not blocking you on this , may be we should move this to a integration test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #6593 to refactor this in future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #6585