Default properties values are not working
See original GitHub issueDescription
Default values are not being applied when a property has one specified and its corresponding attribute is not defined.
Live Demo
https://lit-element-example-km85zd.stackblitz.io
Steps to Reproduce
- Create
my-element
- Define a property with a default value
- Use the default value in the element’s template
- Append
my-element
to document.body
Expected Results
The default value should be rendered
Actual Results
The default value is not rendered (nor is it passed to _render
in the props object)
Browsers Affected
- Chrome – other browsers were not tested
Versions
- lit-element: v0.5.2
- webcomponentsjs: v2.0.2
- polymer: v3.0.2
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8
Top Results From Across the Web
Default properties values are not working · Issue #114 - GitHub
Description. Default values are not being applied when a property has one specified and its corresponding attribute is not defined.
Read more >Spring @Value annotated method, use default value when ...
Problem. Even if I set default values to field itself I get exception when .properties file is not present: org.springframework.beans.
Read more >Using Spring @Value with Defaults - Baeldung
A quick and practical guide to setting default values when using the @Value annotation in Spring.
Read more >Default property values not working in SPFx web part
I have 3 web part properties set up in my spfx web part. However it is not showing the default values I have...
Read more >Setting the default value of Infotable property does not work
Solved: Hi, I have a infotable property in a Thing (Generic Thing), and I have set a default value to that Infotable property,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That makes sense, I’d just add that it’s not super clear from the README and it’s easy to make assumptions since this element is part of the Polymer project. Would it make sense to add some sort of feature comparison to
PolymerElement
in the README?how to solve somehow we want to get values from an element prototype? when we get value from “litelemnt.prototype.accessKey” the browser gets an error and stops running the code.