raphadesa / BlazorInputMask

Blazor Input Mask
MIT License
27 stars 15 forks source link

Value is being cached #13

Closed mongezisithole closed 1 year ago

mongezisithole commented 2 years ago

Hi,

I have a strange problem, I'm not sure if it is my code or what but whenever I try to clear the value of the inputMask it always returns the old value. I clear it by setting the property bound to it to null, it does clears the input but as soon as I enter a new value the old one comes back. I hope I make sense.

raphadesa commented 2 years ago

Hello,

Could you send me a code exerpt you used to achieve this ? You should reset the underlying model by setting it to either null or string.Empty...

mongezisithole commented 2 years ago

This is how we define the control image

This is the ValueChanged() image

And this is how we set the model to empty strings. image

Do you think changing it to string.Empty would make a difference instead of using " "?

raphadesa commented 2 years ago

Hello,

Why don't you use an InputForm with an EditContext like this sample: https://github.com/raphadesa/BlazorInputMask/blob/master/BlazorInputMask/Pages/Index2.razor ? I haven't tested the component with your approach.

mongezisithole commented 2 years ago

Hi,

Even if I do it that way I still get the same issue, it's like the value is being cached somewhere for few minutes. Maybe the problem is with my code.

Thanks,

mongezisithole commented 2 years ago

Hi,

I have made few changes to you code, now everything is working. Do you mind if I push my changes?

raphadesa commented 2 years ago

Hello, yes, please do !