From 0d1e59942000428853dbf77c05fd4f363b109c6c Mon Sep 17 00:00:00 2001 From: Daryl 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: https://develop.svn.wordpress.org/trunk@20035 602fd350-edb4-49c9-b593-d223f7449a82 --- 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,