[wp-trac] [WordPress Trac] #27307: Text Widget size spill over the side of Widget Container in random width.
WordPress Trac
noreply at wordpress.org
Thu Mar 6 23:00:30 UTC 2014
#27307: Text Widget size spill over the side of Widget Container in random width.
--------------------------+------------------------------
Reporter: RDall | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Widgets | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by westonruter):
Such, it seems, is the nature of wide widget controls: they inherently
don't feel right in the current UI.
The Text widget control is registered as having a 400px width:
{{{
$control_ops = array('width' => 400, 'height' => 350);
}}}
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/default-
widgets.php?rev=27443#L395
It seems that the responsive admin is now causing wide widget controls to
not have consistent widths because the sidebar-columns can now have
dynamic widths. The reason that wide widget controls (like the Text
widget) always overhang the left of the container even when the container
is larger than the widget control's specified width, is that the overhang
is currently implemented via a negative left/right margin:
{{{
if ( targetWidth > 250 && ( targetWidth + 30 > widgetWidth ) &&
widget.closest('div.widgets-sortables').length ) {
if ( widget.closest('div.widget-liquid-right').length ) {
margin = isRTL ? 'margin-right' : 'margin-left';
} else {
margin = isRTL ? 'margin-left' : 'margin-right';
}
css[ margin ] = widgetWidth - ( targetWidth + 30 ) + 'px';
widget.css( css );
}
}}}
https://core.trac.wordpress.org/browser/trunk/src/wp-
admin/js/widgets.js?rev=27443#L43
This makes the resulting widget control width relative to the width of the
container.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27307#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list