atomic-server
atomic-server copied to clipboard
Dialog forms are not valid HTML forms - no keyboard support
The Dialog component renders three sections DialogTitle, DialogContent, DialogActions. Currently, I've seen the formelement being used inside theDialogContent. This leads to a situations where the form's onSubmitattribute is not called if a user pressesenter`.
How do we deal with this?
Pass an onSubmit to Dialog
If this is a passed, turn the Dialog wrapper into a form.
Pass onSubmit to useDialog
Always render forms?
Maybe all dialogs are forms by default? Maybe that's the case now, but I'm not sure whether that remains true.
@Polleps what are your thoughts?
onSubmit should be called when a user presses enter and is focussed on an input inside a form that has a submit handler. The only reason it wouldn't fire is if the input were invalid, otherwise it's a browser bug but I think it's more likely just something else that doesn't work.
What specific dialog are you talking about?