# Bug showing value on sp-textfield PS 2024 & 2025

**URL:** <https://forums.creativeclouddeveloper.com/t/bug-showing-value-on-sp-textfield-ps-2024-2025/8840>\
**Category:** UXP Plugin API\
**Tags:** bug, uxp, spectrum\
**Created:** [December 11, 2024, 12:06pm UTC](https://forums.creativeclouddeveloper.com/t/bug-showing-value-on-sp-textfield-ps-2024-2025/8840 "2024-12-11T12:06:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kappasette](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/kappasette/32/3072_2.png) [@kappasette](https://forums.creativeclouddeveloper.com/u/kappasette)\
**Post date:** [December 11, 2024, 12:06pm UTC](https://forums.creativeclouddeveloper.com/t/bug-showing-value-on-sp-textfield-ps-2024-2025/8840/1 "2024-12-11T12:06:03Z")

</div>

**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? 🙂

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

---

<div class="post-metadata">

**Author:** ![Jarda](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jarda/32/1909_2.png) [@Jarda](https://forums.creativeclouddeveloper.com/u/Jarda)\
**Post date:** [December 11, 2024, 12:11pm UTC](https://forums.creativeclouddeveloper.com/t/bug-showing-value-on-sp-textfield-ps-2024-2025/8840/2 "2024-12-11T12:11:34Z")

</div>

Also fixing decimals would be great:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/f/ff5d0de7249698a1f1d7bd203c22fc204bb4a03c.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/e/e83a5f0b1a323be5ed5bda0c98c4998334db909b.png)

---

<div class="post-metadata">

**Author:** ![kappasette](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/kappasette/32/3072_2.png) [@kappasette](https://forums.creativeclouddeveloper.com/u/kappasette)\
**Post date:** [December 11, 2024, 2:25pm UTC](https://forums.creativeclouddeveloper.com/t/bug-showing-value-on-sp-textfield-ps-2024-2025/8840/3 "2024-12-11T14:25:19Z")

</div>

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.

🤦‍♂️

---

<div class="post-metadata">

**Author:** ![Jarda](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jarda/32/1909_2.png) [@Jarda](https://forums.creativeclouddeveloper.com/u/Jarda)\
**Post date:** [December 11, 2024, 2:32pm UTC](https://forums.creativeclouddeveloper.com/t/bug-showing-value-on-sp-textfield-ps-2024-2025/8840/4 "2024-12-11T14:32:10Z")

</div>

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