WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#36050 closed defect (bug) (fixed)

Customizer: gap above widget section when focusing from preview shift+click

Reported by: mattwiebe Owned by: westonruter
Milestone: 4.5 Priority: normal
Severity: normal Version: 4.4
Component: Customize Keywords: has-patch has-screenshots
Focuses: ui Cc:

Description

When focusing on a widget via shift+click in the preview iframe, the widget area panel will render with an incorrect margin-top, producing a large, ugly space.

Steps to reproduce:

  1. Open the Customizer
  2. Shift + click on any widget area
  3. See a large gap above the widget's widget area section

Note that this stops happening every time after you've been navigating through other sections/panels in the Customizer. Focusing on a widget first produces reliable results. Screenshot and patch incoming.

Attachments (2)

36050.diff (512 bytes) - added by mattwiebe 3 years ago.
widget-margin-bug.png (31.5 KB) - added by mattwiebe 3 years ago.

Download all attachments as: .zip

Change History (7)

@mattwiebe
3 years ago

#1 @mattwiebe
3 years ago

  • Keywords has-patch has-screenshots added

All the diff does is move section._recalculateTopMargin() into a setTimeout call with a 0ms timeout to bump it to the top of the call stack, since it's otherwise making calculations based on not quite current layout.

#2 @ocean90
3 years ago

Related: #34391

This ticket was mentioned in Slack in #core-customize by melchoyce. View the logs.


3 years ago

#4 @westonruter
3 years ago

  • Milestone changed from Awaiting Review to 4.5
  • Owner set to westonruter
  • Status changed from new to accepted

I've been noticing this increasingly as well. It seems to be specifically when focusing on a section (or a control within a section) that is within a panel. It also seems to only happen when the contained panel was previously collapsed. If you collapse the section and re-expand it, subsequent focuses on other sections within that panel seem to not have the glitch.

#5 @westonruter
3 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 36805:

Customize: Remove gap above section contained in panel when initially focusing on control.

Props mattwiebe.
Fixes #36050.

Note: See TracTickets for help on using tickets.