Allow for functional links in amp-accordion headers#9335
Merged
kmh287 merged 21 commits intoampproject:masterfrom May 26, 2017
Merged
Allow for functional links in amp-accordion headers#9335kmh287 merged 21 commits intoampproject:masterfrom
kmh287 merged 21 commits intoampproject:masterfrom
Conversation
631db4b to
69970be
Compare
69970be to
cc85994
Compare
kmh287
commented
May 26, 2017
| // for buttons and links, which should not have their default behavior | ||
| // overidden. | ||
| const target = dev().assertElement(event.target); | ||
| if (target.tagName != 'A') { |
Contributor
Author
There was a problem hiding this comment.
Should we support anything else here besides anchor tags?
aghassemi
suggested changes
May 26, 2017
| // for on links, which should not have their default behavior | ||
| // overidden. | ||
| const target = dev().assertElement(event.target); | ||
| if (target.tagName != 'A') { |
Contributor
There was a problem hiding this comment.
this may not work for image links (<a href><amp-img>...). I think we need to check all the ancestors of target up to the header element. ancestorElements(child, predicate) should help find it.
Contributor
Author
|
Thanks! |
Contributor
|
Nice—thanks for jumping in on this, @kmh287 ! /cc @camelburrito as FYI |
Contributor
|
We should not be doing this in accordion, ideally what you need in #7712 could be achieved by using amp-selector. This goes against what an accordion is supposed to do. Could you hold on this till Tuesday when i am back. |
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.
This PR allows links in accordion headers that can be pressed without expanding or collapsing the corresponding accordion section.
Fixes #7712
/to @aghassemi