Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#33088 closed defect (bug) (fixed)

Customizer Menu: Navigation Menu - Save & Publish

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

Description

When using the Customize Menu, if you don't have a pre-selected menu in the Menu location, the drop down menu doesn't initiate the first click on the drop down. Also the "-- Select --" item isn't the default select when no menu is selected, leaving the menu blank.

You will also notice from the video supplied that the Save & Publish button doesn't activate the first time around. It takes two clicks for the button to become active.

I tested it on a WordPress downloaded theme and also on my own custom theme. My theme still doesn't update live like the downloaded theme does, you'll see the code in the below video. If you need anything else let me know.

Video can be viewed here - https://www.youtube.com/watch?v=2yhbRluOXSM

Attachments (1)

33088.diff (476 bytes) - added by westonruter 9 years ago.

Download all attachments as: .zip

Change History (8)

#1 @stuartshields
9 years ago

Sorry, even if you have a pre-selected menu item, it still doesn't initiate the first click on the select menu.

#2 @stuartshields
9 years ago

To reproduce

  1. Click Customize
  2. Click Menus > Menu Locations
  3. Select menu is blank, the default "-- Select --" isn't default, click on a menu item. Nothing happens to the Save & Publish button
  4. Go back and edit the menu's items that you made default in previous step
  5. No live update, no save & publish.
  6. Go back into Menu Locations, click on the menu in the select menu, the screen does a quick refresh and now the Save & Publish button is enabled. Click it to save the menu in that location.
  7. Go back into Menus and add menu items. Live update and Save & Publish works.

Although the live update didn't work on my own template, it still works in the template I downloaded from Wordpress.org

Results
Select Menu requires to be selected twice for it to initiate the menu item

Expected result

  1. "-- Select --" Needs to be the default in the Menu location drop down when no menu item is selected
  2. Single click to initiate the "Save & Publish" button in Menu Location

#3 @westonruter
9 years ago

  • Component changed from Menus to Customize
  • Focuses javascript added; administration removed
  • Keywords reporter-feedback added

@stuartshields Thanks for the report. Are you experiencing this in Firefox? I seem to see something similar to you in Firefox, but in Chrome it is working as expected. Could you confirm that it works as expected for you in Chrome?

@westonruter
9 years ago

#4 @westonruter
9 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.3
  • Owner set to westonruter
  • Status changed from new to accepted

I think I see what the problem is. When a nav_menu_locations[…] setting had its default value of '', then Firefox would not show any selected menu item. But if it had a value of 0, then it would select the first item. So it seems the solution is to just ensure that the default/initial value of the setting is 0. Please try 33088.diff.

#5 @stuartshields
9 years ago

Hi,

I can confirm that the fix in 33088.diff solves the issue.

#6 @westonruter
9 years ago

  • Keywords commit added; reporter-feedback removed

#7 @SergeyBiryukov
9 years ago

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

In 33421:

Customizer: Set a correct default for nav_menu_locations setting.

props westonruter.
fixes #33088.

Note: See TracTickets for help on using tickets.