Open
Description
Suggested implementation plan
- Modify
Navigate
event to take aRequest
rather than aUrl
- Form submission should be triggered on:
- Click of
<input type="submit" />
- Enter key press when single-line text-field is focussed
- Click of
- Write a submission function that:
- Iterates up the tree from the element that triggered the event looking for a
<form>
element (if no<form>
element is found then do nothing) - Reads the
action
andmethod
from the<form>
- Searches the subtree under the
<form>
for input elements (we currently support: text, textarea, radio, checkbox, and hidden). - Composes a
url
andbody
from form attrs and input values. - Generates a
Navigate
event.
- Iterates up the tree from the element that triggered the event looking for a
The initial implementation:
- Wouldn't necessarily need to support all types (maybe just text and hidden?)
- Wouldn't necessarily need to generate a "submit" event for Dioxus Native
- Could assume
enctype
ofapplication/x-www-form-urlencoded
. But should maybe check formultipart/form-data
and do nothing / log warning if it is set.
Although of course these features could be implemented (although probably no point doing multipart encoding until we have file inputs)
Metadata
Assignees
Labels
No labels
Activity