yznts / kyoto

Asynchronous frontends with Go
https://pkg.go.dev/github.com/yznts/kyoto/v3
MIT License
651 stars 28 forks source link

Type system problems while using FormSubmit #149

Closed yznts closed 9 months ago

yznts commented 1 year ago

Original message:

"Say I have a component with a state containing: Page int and I have a template with:

<form onsubmit="FormSubmit(this,event);">
 <input name="Page" type="number" value="1">
</form>

then FormSubmit sends Page as a string, not as a number as I would imagine. I can of course send it as Page2 and in my action convert the string to int and store it as Page, but this seems awkward. Is it possible for FormSubmit to check if an input name exists already within the state, and if so, use the same variable type (like int, bool, string)? Or do you have any other recommendation?"

yznts commented 1 year ago

Forms handling needs to be completely rethought. Will be addressed in v3.

yznts commented 9 months ago

Actions support dropped in v3, in favor of htmx