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

Set web component as properties, not attributes [breaking change] #753

Merged
merged 6 commits into from
Aug 7, 2024

Conversation

wwwillchen
Copy link
Collaborator

@wwwillchen wwwillchen commented Aug 7, 2024

Fixes #730.

Breaking change: Web components are now set via DOM properties and not attributes. This means you can not use Lit's attribute API, e.g.

  static properties = {
    value: {type: Number},
    incrementEventHandlerId: {attribute: 'increment-event', type: String},
  };

I mixed up DOM attributes and DOM properties and only primitive types, e.g. string, number, boolean, worked when I erroneously set the web component properties as DOM attributes. Lit's default converter worked for the primitive types.

@wwwillchen wwwillchen changed the title Set web component as properties, not attributes Set web component as properties, not attributes [breaking change] Aug 7, 2024
@wwwillchen wwwillchen merged commit 0db726c into google:main Aug 7, 2024
3 checks passed
@wwwillchen wwwillchen deleted the prop_wc branch August 7, 2024 19:41
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.

Web component properties do not seem to accept objects or arrays
2 participants