Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Experiment: use the Interactivity API to do client-side form submissions #49305
Experiment: use the Interactivity API to do client-side form submissions #49305
Changes from all commits
71a1eba
8d0803b
b89a19b
e5e61a0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, there's a
comment_form_after
action that can be used to render stuff here. (Though I'm not sure it's worth using it here as it'd require adding the action before thecomment_form()
call and removing it after.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought -- if we're not married to this exact location (i.e. right before the
</form>
, which means after the 'Submit' button), we might also use one of the (many) options to thecomment_form
function. There is e.g.comment_notes_after
which is rendered after thetextarea
(before the 'Submit' button), and which defaults to the empty string.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This brings to mind something important: it could be that when the user submits the form, the button could be positioned at the bottom of the viewport. In such a case, the injected error message container may not be visible when it gets populated. The user could then be very frustrated and rage tap the submit button confounded as to why nothing is happening. Perhaps the error message should get displayed as a snackbar with
position:fixed
or else scrolled into view if not visible.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The snackbar seems like a great idea. The message would also have to get announced when using assistive technologies. In both cases when it’s successful, or it fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the snackbar idea! We can try it to see how it feels and to see how easy it would be to create one with the Interactivity API 🙂