-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form file - more complex form example #3686
base: master
Are you sure you want to change the base?
Conversation
form submit button disabled till it's done. A more thorough check wouldn't let the form submit if there are readers left
Size Comparison
✅ None of the examples has changed their size significantly. |
This example doesn't add anything yew specific. I also don't like the idea of adding more examples using struct components |
I'm happy to change it to be a function component, if that helps.❤️ I got my need covered, I'm just trying to prevent someone else also spending a day digging through docs and code not finding an answer. I made two PRs as more about providing two options for y'all than thinking both are needed: a more complex one showing closer to actual usage than the simpler form one just on how to use a form. Below was my comment when I thought this comment was on the simple form, as a defense of needing a form example in some form (heyo) or another. If there's anything else I can add that you think would better highlight yew I can including it. Or remove (well other than the form, cause showing how simple that is was kinda the point). Oh also, the fact that all the old examples around the webs people use still use the FocusEvent not SubmitEvent despite that changing since 0.18. That was part of why I made an example. -- It's a common enough question that it has to be a pinned comment in discord, which seems like mean it probably causes problems for people who don't seek out the discord? (it's why I joined the discord). Pave the cow paths with your docs, always. Examples often show common usage patterns and how you do something with a top level package, regardless of where in the stack it is, imo. Like the file upload is all gloo and web-sys and js-sys really. If you browse the examples many of them don't add yew specifics, but yew stack specifics. But, I also made a more fleshed out example that shows the interaction of a submit callback versus the file handling triggered by the input box, in another PR [oand r as the case turned out to be a simpler example with just a bare form]. And I'd happily merge this into the file upload example to add an alt text to it if you don't want there to be another example. I do think looking for "hey, how do I do a form full of fields" should be obvious though. |
Description
This gives a more complete picture of how node_refs, form_data, and async file "upload" (aka really just client-side parsing by the browser engine and/or js/wasm) interact.
Checklist
Example tests?