Closed b-giavotto closed 11 months ago
Thank you for filing this issue. In order for us to investigate this issue, please provide a minimal repro project that illustrates the problem without unnecessary code. Please share with us in a public GitHub repo because we cannot open ZIP attachments, and don't include any confidential content.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.
See our Issue Management Policies for more information.
Is there an existing issue for this?
Describe the bug
BlazorServer: apparently there is no way to reject changes to an input box in a onchange event.
Expected Behavior
Steps to reproduce the problem: place an input box, and bind it's value property to a page property called string inputvalue. also bind an onchange event to an eventhandler called checkvalue. Add some code to reject an invalid value and some other to accept the value like this:
Steps To Reproduce
enter an invalid value, by violating the rule applyed on server. in the input. the value should be reverted back as you focus to another control. however this does not happen.
That is because, we are keeping the old value server side so the diffing algo does not apply any change to the input box. Actually the only workaround is to invoke a javascript function that force the textbox value to the old value.
Is there a way a more elegant solution?
Thx Best regards.
Exceptions (if any)
none
.NET Version
does not apply
Anything else?
.