Open thrbnhrtmnn opened 10 months ago
Hi @thrbnhrtmnn ,
Since it's related to my last PR I had a look.
The reason that value is being reset here to placeholder
or if we remove the condition I introduced in my last PR then to 0
is when readonly
or disable
or any other parms
is set, it rerenders with a new instance with default params
hence overwriting the existing set values.
For example if we set the value
to 24
in defaultParams
, then on readonly
set to true, the value will be reset to 24 instead of the placeholder.
So, this is just not the case with readonly
but with all the parameters even when you change the theme from light
to dark
.
Maybe I am missing something here but let me know what do you think.
@usmanreal1 i think this is how storybook does things. instead of changing one attribute on the web-component, it replaces the thing with an entirely new instance.
in order to determinate if that's the issue here, we could place the number input into the example app and see how it behaves over there. i would suggest to give this a shot. if you need any help with that, you can write here :)
in order to determinate if that's the issue here, we could place the number input into the example app and see how it behaves over there. i would suggest to give this a shot. if you need any help with that, you can write here :)
@ChristianHoffmannS2 could you maybe explain to me what we expect from that approach of putting the input into the example app. Should I just put the current input into the example app with the readonly state and see if it behaves accordingly?
Step-by-Step Guide to reproduce
If a different value is set than 0, the bug is not occuring.
Bug Description / False Behaviour
When the Input Field Number has a value and readonly=true, it does not display the value.
Correct Behaviour
When the Input Field Number has a value and readonly=true, it displays the value.
Testing
Check existing unit tests of the component(s) and adjust the tests to prevent this bug from occurring again in the future, if you see a way.
Background