Setting the value of a calcite-input-number does work only if value is a string
See:
https://codepen.io/christophesuter/pen/YPzQXRz?editors=1011
if changing the code input.value=23 to input.value='23' it works
Is this the expected behavior for the future versions ? If not, does anyone have a workaround for this ?
Solved! Go to Solution.
Hey Christophe,
Yes this is expected and is the intended behavior going forward. The is in line with the native input element where the `value` is always a string.
Hey @ChristopheSuter
I've noticed this as well when working in Calcite, but I haven't found a guaranteed fix other than converting the value to a string when it's assigned. I used String(variable) and it dynamically converts it for me. I experimented a bit with your CodePen, but it seems it must be normal.
Cody
Hi @CodyPatterson, basically I have migrated the Core API, so I jumped from 2.10.1 to 3.0.3 and this was not the case before... just wanted to know if converting all to string was mandatory now ..
Hey @ChristopheSuter
I see what you mean, I started in version 2.13 and had this issue as well, after upgrading last week to 3.0.3, it still continues, I'd assume this will be the case for the time being until it is changed, I found the GitHub page for it, and see if I can raise an issue if I figure out what could be causing it!
Cody
Hey Christophe,
Yes this is expected and is the intended behavior going forward. The is in line with the native input element where the `value` is always a string.