Skip to content
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

🐛 [amp story] Change toggleAttribute to set/removeAttribute #37420

Merged
merged 6 commits into from
Jan 20, 2022

Conversation

processprocess
Copy link
Contributor

@processprocess processprocess commented Jan 19, 2022

toggleAttribute is not widely supported so it fails on multiple platforms.

This PR uses the toggleAttribute utility function instead.

Fixes #120, #93

@amp-owners-bot
Copy link

amp-owners-bot bot commented Jan 19, 2022

Hey @gmajoulet! These files were changed:

extensions/amp-story-dev-tools/0.1/amp-story-dev-tools-tab-preview.js
extensions/amp-story-dev-tools/0.1/amp-story-dev-tools.js
extensions/amp-story-page-attachment/0.1/amp-story-draggable-drawer.js
extensions/amp-story/1.0/amp-story-embedded-component.js
extensions/amp-story/1.0/pagination-buttons.js

Hey @mszylkowski! These files were changed:

extensions/amp-story-dev-tools/0.1/amp-story-dev-tools-tab-preview.js
extensions/amp-story-dev-tools/0.1/amp-story-dev-tools.js
extensions/amp-story-page-attachment/0.1/amp-story-draggable-drawer.js

Hey @newmuis! These files were changed:

extensions/amp-story-page-attachment/0.1/amp-story-draggable-drawer.js
extensions/amp-story/1.0/amp-story-embedded-component.js
extensions/amp-story/1.0/pagination-buttons.js

@@ -810,6 +810,7 @@ const forbiddenTermsSrcInclusive = {
'\\.pageXOffset(?!_)': bannedTermsHelpString,
'\\.pageYOffset(?!_)': bannedTermsHelpString,
'\\.innerWidth(?!_)': bannedTermsHelpString,
'\\.toggleAttribute(?!_)': 'please use `toggleAttribute()` from core/dom',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jridgewell I feel like we should add this to forbidden terms to prevent future errors. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚨 Error: i.toggleAttribute is not a function
5 participants