Opened 9 years ago
Closed 9 years ago
#41623 closed defect (bug) (fixed)
Wide widgets in Customizer fail set max-height on wrong container for Text and Media widgets
| Reported by: | westonruter | Owned by: | westonruter |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.9 |
| Component: | Customize | Version: | 4.8 |
| Severity: | normal | Keywords: | has-patch has-screenshots |
| Cc: | Focuses: |
Description
The Text widget and Media widgets put their controls outside of the .widget-content element since it gets replaced with fields from the server with each save, and since these widgets have JS-managed fields this eliminates the need to re-initialize the fields (with a flicker) every time the widget is saved.
For “wide widgets” in the Customizer, the widget is positioned in a way that it can be floated over the preview for more room. However, the Text and Media widgets when extended (and wide) will currently appear too tall because the max-height is still set on .widget-content when instead it needs to be set on the parent .form element.
Easy way to reproduce the problem is to add an mu-plugin with the following:
<?php require_once ABSPATH . '/wp-includes/widgets/class-wp-widget-text.php'; class Extended_Text_Widget extends WP_Widget_Text { function __construct() { parent::__construct(); $this->id_base = 'extended_text'; $this->name = __( 'Extended Text' ); $this->option_name = 'widget_' . $this->id_base; $this->widget_options['description'] = __( 'Extended arbitrary text.' ); $this->control_options['id_base'] = $this->id_base; } } add_action( 'widgets_init', function() { register_widget( 'Extended_Text_Widget' ); } );
If you add this widget in the Customizer, you'll see it takes up the entire vertical space instead of just the space needed for the editor.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 41246: