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

feat(switch): fix error caused by setting role in constructor (fixes #1740) #1741

Merged
merged 1 commit into from Jul 5, 2022

Conversation

riovir
Copy link
Contributor

@riovir riovir commented Jul 5, 2022

What I did

Intending to fix the LionSwitch throwing an error in non-lit environments:

  1. Relocated setting the role to 'switch' from the constructor to the connectedCallback.
  2. Considering that someone else may also want to set it differently, so it only happens if it had a falsy value
  3. Added a test intentionally using basic document.createElement instead of relaying on lit in order to trigger the bug.

@changeset-bot
Copy link

changeset-bot bot commented Jul 5, 2022

🦋 Changeset detected

Latest commit: 7b930a8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lion/switch Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Co-authored-by: jorenbroekema <joren.broekema@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants