Bug showing value on sp-textfield PS 2024 & 2025

Tested on
PS 2024 (25.12)
PS 2025 (26.1)

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? :slight_smile:

Adobe please make all the Spectrum the elements behave better… these are your own elements, after all! Pretty please! :joy:

Also fixing decimals would be great:


image

1 Like

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:

  1. Grab the input (string) from the <sp-textfield>
  2. Replace , with . in the string
  3. Convert it to float
  4. Limit it between Min and Max values
  5. Save it as a float where I need it to be saved
  6. 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.

:man_facepalming:

1 Like

Yes… I think you got that flow right. Welcome to Spectrum Components!

1 Like