Closed MycroBeat closed 4 months ago
Thank you for the report. The bug is now fixed.
Look fixed, but i have some question. It is normal when first i submit, change the change and the resubmited and the text get the first submit? I attach a video. Maybe i'm using the hydro incorrectly.
i checked the code and this my be a problem with latest bidding feature from hydro.js
after January 2024.
https://github.com/hydrostack/hydro/assets/19955745/66bac3b6-07dc-47e1-9f78-1eaced28e33e
Yes you're correct. It seems there was a bug introduced releted to the race condition between bind and action. That's why if you focus out the field first and then click submit it works. I will fix that shortly, thanks again.
Moved to #35
Hello. Very interesting project. Keep up working on it.
I found a bug with
forms
on latest 0.14.0 release. On the latest release, when you click the submit button on a form, the page the data is lost and the page refresh by itself. I'm using the example withform validation
from the documentation like in this example below. Even if i bind the input usinghydro-bind
the symtoms are the same.public class FormValid : HydroComponent
{
[Required, MaxLength(50)]
public string? Name { get; set; }
public void Submit()
{
if (string.IsNullOrEmpty(Name) == true)
{
Console.WriteLine("Name is null");
}
Console.WriteLine("A:" + Name);
}
}
@model FormValid
<form hydro-on:submit="@(() => Model.Submit())">
<label asp-for="Name"></label>
<input class="form-control" asp-for="Name" hydro-bind />
<span asp-validation-for="Name"></span>
<button class="btn btn-outline-primary" type="submit">Submit</button>
</form>
This example works ok in 0.11.0.