WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#26417 closed defect (bug) (fixed)

Extra, visible widget information flashes when clicking to add widgets

Reported by: jeremyfelt Owned by: azaozz
Milestone: 3.8 Priority: low
Severity: minor Version: 3.8
Component: Widgets Keywords:
Focuses: Cc:

Description

Not entirely sure that's the best description. Here's a video that shows the behavior. The sidebar selection flashes up at the bottom of the screen briefly as the widget is added to the sidebar.

This happens in both Chrome and Firefox on OSX.

Attachments (2)

26417.diff (572 bytes) - added by jeremyfelt 7 years ago.
26417.2.diff (826 bytes) - added by azaozz 7 years ago.

Download all attachments as: .zip

Change History (10)

#1 @jeremyfelt
7 years ago

  • Milestone changed from Awaiting Review to 3.8

The chooser is appended to the body before the widget is added in http://core.trac.wordpress.org/browser/trunk/src/wp-admin/js/widgets.js#L411

#2 @nacin
7 years ago

I was just trying to track down this same thing.

@jeremyfelt
7 years ago

#3 @jeremyfelt
7 years ago

26417.diff removes an unnecessary append of the chooser content to the body. The same functionality happens later and in an appropriate way when the closeChooser function fires here http://core.trac.wordpress.org/browser/trunk/src/wp-admin/js/widgets.js#L458

#4 follow-up: @azaozz
7 years ago

26417.diff will break the "chooser" when a widget with an open chooser is dragged to a sidebar. Looking for something better :)

#5 in reply to: ↑ 4 ; follow-up: @jeremyfelt
7 years ago

Replying to azaozz:

26417.diff will break the "chooser" when a widget with an open chooser is dragged to a sidebar. Looking for something better :)

I can't figure out how yet, but I'm trying. Things seem to be acting the same for the 'drag while open' behavior with and without the patch.

Whenever addWidget() is run, closeChooser() is run immediately after. The same append of chooser happens there, but paired with a slide up. From what I can tell, nothing in $('#wpbody-content').append( chooser ); is touched in addWidget() beyond that one line, so removing it doesn't seem to break anything.

@azaozz
7 years ago

#6 in reply to: ↑ 5 ; follow-up: @azaozz
7 years ago

Replying to jeremyfelt:

The only thing is, at that point the chooser is inside the widget, then the widget html gets cloned, so the chooser is cloned too. We don't want that second copy of the chooser.

Can you confirm if 26417.2.diff works.

#7 in reply to: ↑ 6 @jeremyfelt
7 years ago

Replying to azaozz:

Can you confirm if 26417.2.diff works.

Yup, works good for me.

#8 @azaozz
7 years ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In 26651:

Widgets: on clicking Add, don't move the chooser out of the widget early as that makes is visible at the bottom of the screen. Remove the cloned copy of it instead. Part-props jeremyfelt, fixes #26417.

Note: See TracTickets for help on using tickets.