When changing the value inside a <sp-textfield> via code, if the value is a number the textfield goes back to showing the placeholder text instead of the number, even if the value attribute is changed (and mostly retrieved) correctly.
This happens even if the textfield is of type=“number”.
If you need it, a workaround to make it display correctly is to make the value a string before assigning it, either casting or simply putting “” + in front of it.
How do I report a bug?
Adobe please make all the Spectrum the elements behave better… these are your own elements, after all! Pretty please!
Thank you, that actually made me understand why it went crazy (again) when I was trying to set a string that contained , (trying to sanitise the value with min and max)!
Basically the only flow I found to work as I want is:
Grab the input (string) from the <sp-textfield>
Replace , with . in the string
Convert it to float
Limit it between Min and Max values
Save it as a float where I need it to be saved
Send the sanitised value back to the <sp-textfield> as a string again, but without replacing back (silly me for trying) . to , as it will do it by itself.