Make WordPress Core

Opened 23 months ago

Last modified 23 months ago

#55913 new enhancement

Custom Fields table can have extra-wide checkboxes and radio buttons

Reported by: princeofabyss's profile princeofabyss Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.0
Component: Editor Keywords:
Focuses: css Cc:

Description

In Custom Fields feature, there is an unforeseeable problem in a specific CSS rule defined for div#postcustomstuff.

More specifically there is this defined in wp-admin/css/edit.css:

#postcustomstuff table input, #postcustomstuff table select, #postcustomstuff table textarea {
  width: 96%;
  margin: 8px;
}

While this works well in the situation the rule was written for, it hides a problem when attempted to reuse the code for other cases, where a checkbox or checkbox or radio button is used, as it stretches them out.

https://i.ibb.co/hmX30Nx/Screenshot-2022-06-03-230840.jpg

You might want to consider excluding those two from the CSS rule...

#postcustomstuff table input:not([type=checkbox]):not([type=radio]),

Change History (1)

#1 @sabernhardt
23 months ago

  • Summary changed from CSS possible undorseeable bug in Custom Fields table to Custom Fields table can have extra-wide checkboxes and radio buttons

With the more specific selector, that will also need to exclude the submit button. r53168 excludes more button types, and this probably could use something similar:

#postcustomstuff table input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
#postcustomstuff table select,
#postcustomstuff table textarea {
	width: 96%;
	margin: 8px;
}

Wrapping the exceptions inside :where() might be worth considering as well.

Note: See TracTickets for help on using tickets.