Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#30818 closed defect (bug) (fixed)

Customizer: Cannot Reorder/Move widget to new widget area in Firefox

Reported by: tywayne's profile tywayne Owned by: ocean90's profile ocean90
Milestone: 4.2 Priority: normal
Severity: normal Version: 3.9
Component: Customize Keywords: has-patch
Focuses: javascript Cc:

Description

Steps to recreate:

  1. Activate a theme with multiple sidebars registered (I was using TwentyFourteen).
  2. Go to Appearance -> Customize, then select Widgets
  3. Toggle view of widgets in one of the sidebars
  4. Click Reorder, then the 'move widget' icon
  5. This will toggle a list of other registered sidebar areas where you can move the widget to. Attempting to select one of them will do nothing but give ReferenceError: event is not defined error.

The error is in lines 684-693 of /wp-admin/js/customize-widgets.js

this.container.find( '.widget-area-select' ).on( 'click keypress', 'li', function( e ) {
    if ( event.type === 'keypress' && ( event.which !== 13 && event.which !== 32 ) ) {
	return;
    }
    e.preventDefault();
    selectSidebarItem( $( this ) );
} );

The parameter passed to the function is e but then referenced in the function as event

Chrome/Safari seem to ignore this and work just fine, but Firefox throws the error and doesn't allow the action.

Attachments (1)

30818.diff (590 bytes) - added by tywayne 10 years ago.

Download all attachments as: .zip

Change History (4)

@tywayne
10 years ago

#1 @tywayne
10 years ago

  • Keywords has-patch added

#2 @ocean90
10 years ago

  • Milestone changed from Awaiting Review to 4.2
  • Version changed from trunk to 3.9

#3 @ocean90
10 years ago

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

In 30992:

Customizer: Use correct event variable when moving widgets to another widget area.

Fixes "ReferenceError: event is not defined error." in Firefox.

props tywayne.
fixes #30818.

Note: See TracTickets for help on using tickets.