Blazor playground

Nova v3.38.0

Preview

Blazor

nv-fielddate migration

Listening to valueChanged now that dateChange is gone.

← nv-fielddate

Migrating date-field callbacks in Blazor

DateChangeEvent has been replaced by ValueChanged. The callback now receives the date string directly, rather than an object containing Value.

Before#

razor<NvFielddate DateChangeEvent="args => Save(args.Value)" />

After#

razor<NvFielddate ValueChanged="Save" />

@code {
    private void Save(string? value)
    {
        // Persist the selected date, or clear it when value is empty.
    }
}

Use @bind-Value when the selected date belongs to component state:

razor<NvFielddate @bind-Value="date" />

@code {
    private string? date;
}

Update callback tests to pass the string value instead of the former payload object. The same ValueChanged/@bind-Value pattern applies to other Nova fields.