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

[scoped-custom-element-registry] Toggle attribute should only trigger attributechangedcallback on change #557

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jessevanassen
Copy link

Fixes #556.

I fixed this by only triggering the attributeChangedCallback if the attribute's value was actually different. I've also added a test to assert the behavior.

There were no tests to assert the behavior of attributeChangedCallback in combination with setAttribute, removeAttribute and toggleAttribute, so I've added additional tests for this as well.

@justinfagnani
Copy link
Collaborator

Looks good, but there's a formatting error on the changelog. I'm going to see if I can push to your branch to fix.

*wow, that's a long branch name! my terminal's having trouble with it.

@justinfagnani
Copy link
Collaborator

ah, I don't have permissions to push.

Copy link
Collaborator

@justinfagnani justinfagnani left a comment

Choose a reason for hiding this comment

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

Thanks for the issue, fix, and tests!

You just need to rebase or merge master and fix the formatting on the changelog (npm run format from the repo root should do it)

@jessevanassen jessevanassen force-pushed the scoped-custom-element-registry--toggle-attribute-should-only-trigger-attributechangedcallback-on-change branch from 63d244f to 3bbada4 Compare August 23, 2023 05:56
@jessevanassen
Copy link
Author

Thanks for the quick response and the pointers to fix it @justinfagnani!
Apologies for the formatting issue in the changelog. Fixed it, and rebased the branch so it's up to date with master.

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