EditContext.IsModified() becomes true after updating bound property programmatically

Hi,

When programmatically updating a bound property of any Syncfusion Blazor input component, it triggers a field change on the form marking the EditContext as modified.

This is not how the built-in blazor inputs work.

To see the difference, you can use the following code:

@page "/"
@using Syncfusion.Blazor.Inputs

<EditForm Model="@Dto1">
    <h4>
        Form with SfTextBox
    </h4>

    <SfTextBox @bind-Value="Dto1.Name"></SfTextBox>
    <br />
    <h4>
        EditContext.IsModified(): @context.IsModified()
    </h4>
</EditForm>

<hr />

<EditForm Model="@Dto2">
    <h4>
        Form with InputText
    </h4>

    <InputText @bind-Value="Dto2.Name"></InputText>
    <br />
    <h4>
        EditContext.IsModified(): @context.IsModified()
    </h4>
</EditForm>

@code{

    public class PersonDto
    {
        public string Name { get; set; }
    }

    public PersonDto Dto1 { get; set; } = new();

    public PersonDto Dto2 { get; set; } = new();

    protected override async Task OnInitializedAsync()
    {
        // Some call to the server to get some values
        await Task.Delay(5000);

        // Update some bound property on the dto
        Dto1.Name = "1111";
        Dto2.Name = "2222";
    }

}


Is there a way to change this behavior?

Thanks in advance

Attachment: BlazorApp5_5518a766.zip

4 Replies 1 reply marked as answer

PM Ponmani Murugaiyan Syncfusion Team January 13, 2021 04:10 AM UTC

Hi Augusto, 

Greetings from Syncfusion support. 

We have considered the reported issue as bug “EditContext.IsModified() becomes true after updating value programmatically” in our end. The fix will be included in one of our upcoming patch release scheduled on January 27, 2021. You can track the status using the below feedback link. 


We appreciate your patience until then. 

Regards. 
Ponmani M 



AB Augusto Barreto January 13, 2021 11:27 AM UTC

Great. Thanks.


PM Ponmani Murugaiyan Syncfusion Team January 13, 2021 12:01 PM UTC

Hi Augusto, 

Thanks for the update. The fix will be include in January 27, 2021 weekly patch release. We appreciate your patience until then. 

Regards, 
Ponmani M 



DR Deepak Ramakrishnan Syncfusion Team August 13, 2021 11:11 AM UTC

Hi Augusto, 


 
We are glad to announce that our patch release v18.4.0.35  is rolled out. The fix for the reported issue “EditContext.IsModified() becomes true after updating value programmatically” is resolved, So please upgrade your package to the mentioned version or to the latest(v19.2.0.55) to avail the fix . Please find the release notes below: 


 
 


 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 


 
Regards,           
Deepak R. 
 
 


Marked as answer
Loader.
Up arrow icon