#49013 closed defect (bug) (fixed)
Alignment of form controls inside a custom meta box
Reported by: | dontdream | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 5.3.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | has-screenshots has-patch commit fixed-major |
Focuses: | ui, css | Cc: |
Description
This is a follow-up to #48420.
I appreciate the recent improvements to the admin CSS, and I wish to submit to your attention this use case. Even with WP 5.3.1, a misalignment is visible, at least in Chrome and Firefox.
To reproduce, use the following plugin which adds a meta box to the page edit screen.
/* Plugin Name: A CSS test plugin Plugin URI: https://www.dontdream.it/ Description: A CSS test plugin. Version: 1.0 Author: Andrea Tarantini Author URI: https://www.dontdream.it/ */ add_action ('add_meta_boxes', 'ctp_add_meta_boxes'); function ctp_add_meta_boxes () { add_meta_box ('ctp_fields_box', 'CSS Test Plugin', 'ctp_fields_box', 'page', 'normal'); } function ctp_fields_box ($post) { ?> <div> <div> <select> <option value="1">First</option> <option value="2">Second</option> </select> <input type="text" placeholder="Input 1"> <input type="text" placeholder="Input 2"> <select> <option value="1">First</option> <option value="2">Second</option> </select> </div> <div> <select> <option value="1">First</option> <option value="2">Second</option> </select> <input type="text" placeholder="Input 1"> <input type="text" placeholder="Input 2"> <select> <option value="1">First</option> <option value="2">Second</option> </select> </div> </div> <?php }
Thank you!
Attachments (4)
Change History (18)
#2
@
5 years ago
- Keywords has-screenshots added; needs-screenshots removed
The uploaded image shows the misalignment between select and input controls. As previously mentioned, this test meta box is added to the page edit screen by the provided code.
#3
@
5 years ago
- Milestone changed from Awaiting Review to 5.3.3
- Owner set to audrasjb
- Status changed from new to accepted
- Type changed from enhancement to defect (bug)
#4
@
5 years ago
- Keywords has-patch added
Pinging @afercia: as you handled the last fixes in vertical-align issues, could you please review the above patch?
Thanks 😉
#6
@
5 years ago
- Milestone changed from 5.3.3 to 5.4
Moving all unfixed tickets from 5.3.3 to milestone 5.4, as there is no plan for a 5.3.3 maintenance release for now.
#10
@
5 years ago
- Keywords fixed-major added
- Milestone changed from 5.4 to 5.3.3
- Resolution fixed deleted
- Status changed from closed to reopened
Since this appears to be a regression in 5.3, let's merge this to the 5.3 branch.
#12
follow-up:
↓ 14
@
5 years ago
Related: https://core.trac.wordpress.org/ticket/48420#comment:20
Vertical alignments never worked very well in the WordPress admin. See the screenshot below, with the test plugin from this ticket activated on WordPress 5.2. See the misalignments are unrelated to the CSS changes in 5.3. Not a regression but good to improve it anyways :)
However, as mentioned on ticket:48420#comment:20 vertical alignments would need to be improved across the whole admin. There are a few options for that. Using vertical-align: middle
is one option but it will fail as soon as one of the elements or associated labels has top/bottom margins. Looking forward to a second round of admin CSS improvements :)
#14
in reply to:
↑ 12
@
5 years ago
Replying to afercia:
Vertical alignments never worked very well in the WordPress admin. See the screenshot below, with the test plugin from this ticket activated on WordPress 5.2. See the misalignments are unrelated to the CSS changes in 5.3. Not a regression but good to improve it anyways :)
Thanks for the clarification :)
Hi there, welcome to WordPress Trac! Thanks for the ticket.
Could you add a screenshot to illustrate the issue?