From 0f960750b0aed58c679b7a75e5dc0e86a0f05693 Mon Sep 17 00:00:00 2001 From: koopersmith Date: Wed, 29 Feb 2012 06:28:02 +0000 Subject: [PATCH] Theme Customizer: Don't switch themes and update settings when the enter key is pressed. see #19910. git-svn-id: http://svn.automattic.com/wordpress/trunk@20035 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/customize-controls.dev.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wp-includes/js/customize-controls.dev.js b/wp-includes/js/customize-controls.dev.js index b29c3b7d27..d66b10a319 100644 --- a/wp-includes/js/customize-controls.dev.js +++ b/wp-includes/js/customize-controls.dev.js @@ -75,6 +75,12 @@ }); this.refresh(); + + // Prevent the form from saving when enter is pressed. + this.form.on( 'keydown', function( e ) { + if ( 13 === e.which ) // Enter + e.preventDefault(); + }); }, loader: function() { var self = this,