WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#33010 closed defect (bug) (fixed)

Customizer menu live preview not updating when adding and removing menu items

Reported by: stuartshields Owned by: westonruter
Milestone: 4.3 Priority: normal
Severity: normal Version: 4.3
Component: Customize Keywords: has-patch commit
Focuses: javascript Cc:

Description

When using the Customizer menu and adding items to a menu after "Save & Publish" is hit, the live "preview" doesn't update to show the newly updated menu items. The page needs to be refreshed for the new items to show.

Attachments (2)

Screen Shot 2015-07-16 at 2.34.38 pm.png (825.2 KB) - added by stuartshields 6 years ago.
33010.diff (3.2 KB) - added by westonruter 6 years ago.
https://github.com/xwp/wordpress-develop/pull/103

Download all attachments as: .zip

Change History (10)

#1 @obenland
6 years ago

  • Milestone changed from Awaiting Review to 4.3

#2 @netweb
6 years ago

  • Summary changed from Customizer Menu: Adding new items to Customizer menu live preview not updating when adding and removing menu items

The original reporter is running Beta 3 (r33288), my test below is using r33291

In the following video it shows similar to the reported issue, though in this case I'm removing an item from the menu and live preview does not update, the menu item does not show it has been removed until after closing the customizer:

https://cloudup.com/cMJPCfudufe

#3 @westonruter
6 years ago

  • Keywords needs-patch added
  • Owner set to westonruter
  • Status changed from new to accepted

#4 @westonruter
6 years ago

  • Focuses javascript added; administration removed
  • Keywords has-patch needs-testing added; needs-patch removed

@stuartshields, @netweb: I believe I've addressed the issues identified in 33010.diff. Please test.

I believe the main issue was introduced with the performance optimizations done in [33138], so part of the fix is to ensure that all of the relevant settings get sent along with the partial-refresh request for the menu, including any deleted menu items and any settings for nav menu locations. I also noticed a conflict with the Customizer Partial Refresh plugin which I hadn't noticed before, so I made the binding of the setting change events more robust as well.

#5 @stuartshields
6 years ago

@westonruter I've tested it and it works. Thanks for the fix.

#6 @westonruter
6 years ago

  • Keywords commit added; needs-testing removed

#7 @netweb
6 years ago

Likewise for me, works as expected now, thanks Weston.

#8 @westonruter
6 years ago

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

In 33328:

Customizer: Fix previewing certain changes to nav menus.

Addresses regression introduced in [33138], where deleted menu items would not be removed from the preview, and changes to a location's assigned menu would likewise not preview. Also makes the binding of the setting change events more robust.

Fixes #33010.

Note: See TracTickets for help on using tickets.