Closed a7medm7med closed 5 months ago
Thanks! Something doesn't appear to be right here, I'll get it ingested into our backlog
@a7medm7med I took a look at this issue again and your provided reproduction case. I was able to get the expected behavior by applying the following patch: Changes-On-fb174e.patch
I did need to update your component's render
function to render a tag since when I added reflect
to the prop, the text no longer appeared... I'll look into that separately from this issue.
Let me know if that works for you!
@tanner-reits Thanks for your update and for sharing the patch. However, in my case, I found that I don't need to use the reflect option. Additionally, it seems that the issue extends beyond just the appearance of the text; the attribute itself should not remain.
Let me know if you have any thoughts or if there are any updates on your end!
@a7medm7med I'm a little confused what you mean by "in my case, I found that I don't need to use the reflect option". reflect
is what keeps the property value in sync with an attribute value. If reflect: true
is not set on the @Prop()
, then the attribute cannot be removed by the runtime. You can read a bit more about this option in the Stencil docs.
@tanner-reits To be honest, I can't recall the specific problem I encountered, but it seems that the 'reflect' option suffices for now. Let's close this issue temporarily. If I encounter any further issues, I'll create a new one.
Prerequisites
Stencil Version
4.12.6
Current Behavior
The
disabled
attribute remains on the element even after setting the property to false.Expected Behavior
The
disabled
attribute should be removed from the element when the corresponding property is set to false.System Info
Steps to Reproduce
1- Set up a StencilJS component with a boolean property, for example: 2- Instantiate the component and set the property to false programmatically, for example: 3- Observe that the disabled attribute is not removed from the element.
Code Reproduction URL
https://github.com/a7medm7med/stencil-bug-3
Additional Information
No response