#46600 closed defect (bug) (fixed)
Twenty Nineteen: Flex order on comment form causes contents of comment_form_after to appear above the form
Reported by: | garrett-eclipse | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 6.0 | Priority: | normal |
Severity: | normal | Version: | 5.0 |
Component: | Bundled Theme | Keywords: | has-patch has-dev-note |
Focuses: | accessibility, css | Cc: |
Description
In the Twenty Nineteen theme the comment form design uses flexbox order CSS properties.
When contents are injected via the comment_form_after
they're expected to appear below the form, for instance the Akisment privacy message. Due to the flex order the contents instead appears before the form.
Attaching screenshots
Attachments (5)
Change History (19)
#1
@
3 years ago
- Focuses accessibility css added; ui removed
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
The order has been like this since the initial commit, so I do not understand why it was done this way. But making the visual order match the DOM is important, with or without the comment_form_after
content.
@
3 years ago
creating a new container class to avoid flex order, hiding that container in print styles, moving heading before the form (in the markup)
#2
@
3 years ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Future Release to 6.0
Adding a message also hides the "Leave a comment" heading, and 46600.diff shows it again.
The patch uses a new class to stop using CSS flex, but any child theme with the old markup still would have the older styles. And this new container is hidden in the print stylesheet.
The patch does not match the styles perfectly when no messages are added. The 1rem
top margin for the short line above the heading does not apply (it's included in the wrapper's margin), though I'm not convinced that the extra space is necessary.
#3
@
3 years ago
- Keywords dev-feedback added
@sabernhardt thanks, the patch looks great to me but I'm only wondering about replacing class comment-form-flex
with comment-form-wrapper
, since it would introduce a breaking change for people who customized this container. For the sake of backward compatibility, could we keep the previous class?
#4
@
3 years ago
- Keywords needs-patch added; has-patch dev-feedback removed
I thought to switch classes for the structure, but did not account for several other possibilities (changing text or background color, adding a border, etc.).
It probably should add a new class and keep the existing class, which requires a bit more CSS editing.
This ticket was mentioned in PR #2431 on WordPress/wordpress-develop by sabernhardt.
3 years ago
#5
- Keywords has-patch added; needs-patch removed
Fix the DOM order in the comment form, and add a new .comment-form-wrapper
class to change flex
display to block
.
Trac ticket: https://core.trac.wordpress.org/ticket/46600
#6
@
3 years ago
- Keywords needs-refresh added
The print styles apparently do not need editing with this way. Both .comment-form-flex
and .comment-form-wrapper
have the same level of specificity.
#7
@
3 years ago
- Keywords needs-refresh removed
The pull request is updated, including the RTL stylesheet and correcting an HTML comment for another container.
This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.
3 years ago
#10
@
3 years ago
- Keywords assigned-for-commit commit needs-dev-note added
Thank you @sabernhardt for the changes.
The pull request looks good to me know.
Self assigning for commit
and adding needs-dev-note
keyword so this new class could be referenced on a Bundled Themes dev note or in the Misc changes dev note 📗
3 years ago
#13
Committed in https://core.trac.wordpress.org/changeset/52993
#14
@
3 years ago
- Keywords has-dev-note added; needs-testing assigned-for-commit commit needs-dev-note removed
The field guide mentions this change.
If someone wants to write about this in a Bundled Themes note as well, it could be worth adding how child themes that replace the parent style.css and/or comments.php would retain the flex order.
Akismet content injected via comment_form_after appearing above comments form