WordPress.org

Make WordPress Core

Opened 2 months ago

Last modified 4 weeks ago

#40862 assigned enhancement

Partially visible controls within a pane do not scroll into view

Reported by: desrosj Owned by: jpurdy647
Milestone: Future Release Priority: low
Severity: normal Version:
Component: Customize Keywords: has-screenshots good-first-bug has-patch
Focuses: Cc:

Description

If the widget pane has many widgets, sometimes the widget dialogue will not be visible when the edit shortcut icon is clicked on the page. If any part of the control is visible, it does not fully scroll into view even though the focus is properly set.

A few notes:

  • If the widget is not in view at all wihtin the pane, it properly scrolls it into view and focuses.
  • The problem also occurs if the pane is not currently visible when the edit shortcut is clicked.

Clicked edit shortcut on a widget in view in the sidebar:
https://cloudup.com/cVy1-KAReQv+

Clicked edit shortcut on a widget with part of the header visible in the pane:https://cloudup.com/iQyTvRrX_rX+

Attachments (3)

scrollToOpenedWidgets.diff (1.9 KB) - added by jpurdy647 8 weeks ago.
Patch to scroll clipped widgets into view
scrollToOpenedWidgets-2.diff (1.5 KB) - added by jpurdy647 8 weeks ago.
Patch to scroll clipped widgets into view - revised
40862.patch (541 bytes) - added by m1tk00 7 weeks ago.
Scroll to opened widget

Download all attachments as: .zip

Change History (7)

#1 @westonruter
2 months ago

  • Milestone changed from Awaiting Review to Future Release

The issue is that the widget's toggle is a focusable element, and so it can be focused without the rest of the widget control being shown. In fact, the rest of the widget control may not be fully expanded by the time the control is focused. Maybe when a control is focused, and it has an expanded state (such as widgets and nav menu items), when it finishes expanding it should also call scrollIntoView if needed (or even scrollIntoViewIfNeeded).

@jpurdy647
8 weeks ago

Patch to scroll clipped widgets into view

@jpurdy647
8 weeks ago

Patch to scroll clipped widgets into view - revised

#2 @jpurdy647
8 weeks ago

  • Keywords has-patch added; needs-patch removed

Widgets now scroll into view when opened. It will only scroll down if the widget is clipped on the bottom of the screen. Can't think of any way a widget could be clipped on the top of the screen. I can add that if there is some situation scrolling up to make a widget visible would be necessary.

@m1tk00
7 weeks ago

Scroll to opened widget

#3 @jpurdy647
7 weeks ago

The problem with scrollIntoView() is that it jumps the element to the top of the screen immediately, interrupting the user experience.

My approach is to check whether the widget will be clipped on the bottom (or be too close to the bottom of the screen) and if so smoothly scroll down while the widget is sliding open.

#4 @DrewAPicture
4 weeks ago

  • Owner set to jpurdy647
  • Status changed from new to assigned

Assigning ownership to mark the good-first-bug as "claimed".

Note: See TracTickets for help on using tickets.