# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: C:\xampp\htdocs\wordpress\trunk
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: src/wp-admin/js/customize-widgets.js
--- src/wp-admin/js/customize-widgets.js Base (BASE)
+++ src/wp-admin/js/customize-widgets.js Locally Modified (Based On LOCAL)
@@ -316,9 +316,12 @@
 				isEsc = ( event.which === 27 ),
 				isDown = ( event.which === 40 ),
 				isUp = ( event.which === 38 ),
+				isTab = ( event.which === 9 ),
+				isShift = ( event.shiftKey ),
 				selected = null,
 				firstVisible = this.$el.find( '> .widget-tpl:visible:first' ),
 				lastVisible = this.$el.find( '> .widget-tpl:visible:last' ),
+				isLastWidgetFocused =  $( event.target ).is( '.widget-tpl:visible:last' ),
 				isSearchFocused = $( event.target ).is( this.$search );
 
 			if ( isDown || isUp ) {
@@ -357,7 +360,21 @@
 			} else if ( isEsc ) {
 				this.close( { returnFocus: true } );
 			}
+                        
+			if ( isTab ) {
+				if( isShift ) {
+					if ( isSearchFocused ) {
+						$( '.control-section:has(.open) .add-new-widget' ).focus();
+						event.preventDefault();
 		}
+				} else {
+					if ( isLastWidgetFocused ) {
+						$( '.control-section:has(.open) .add-new-widget' ).focus();
+						event.preventDefault();
+					}
+				}
+			}
+		}
 	});
 
 	/**
