Widgets: Prevent currently active wide widget controls from being partially covered by another widget's controls.

The currently active widget controls should always be displayed on top.

Props audrasjb, fervillz, rinkuyadav999, jaydeep23290, ashokrd2013, melchoyce, pento, westonruter, SergeyBiryukov.
Fixes #42001.

git-svn-id: https://develop.svn.wordpress.org/trunk@47263 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-02-11 15:24:47 +00:00
parent 08b3c1d123
commit f26d4d3735
2 changed files with 9 additions and 3 deletions

View File

@ -127,8 +127,7 @@ window.wpWidgets = {
}); });
$(document.body).bind('click.widgets-toggle', function(e) { $(document.body).bind('click.widgets-toggle', function(e) {
var target = $(e.target), var target = $(e.target), css = {},
css = { 'z-index': 100 },
widget, inside, targetWidth, widgetWidth, margin, saveButton, widgetId, widget, inside, targetWidth, widgetWidth, margin, saveButton, widgetId,
toggleBtn = target.closest( '.widget' ).find( '.widget-top button.widget-action' ); toggleBtn = target.closest( '.widget' ).find( '.widget-top button.widget-action' );
@ -212,7 +211,7 @@ window.wpWidgets = {
handle: '> .widget-top > .widget-title', handle: '> .widget-top > .widget-title',
distance: 2, distance: 2,
helper: 'clone', helper: 'clone',
zIndex: 100, zIndex: 101,
containment: '#wpwrap', containment: '#wpwrap',
refreshPositions: true, refreshPositions: true,
start: function( event, ui ) { start: function( event, ui ) {

View File

@ -6,6 +6,13 @@
box-sizing: border-box; box-sizing: border-box;
} }
.widget.open {
z-index: 99;
}
.widget.open:focus-within {
z-index: 100;
}
.widget-top { .widget-top {
font-size: 13px; font-size: 13px;
font-weight: 600; font-weight: 600;