From 5abcaa52d74fd87abecaa5b8455478f27ce273f3 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 7 Jun 2012 22:00:59 +0000 Subject: [PATCH] Customizer: Add keyup events to sync textarea values. Props koopersmith. fixes #20879 git-svn-id: https://develop.svn.wordpress.org/trunk@21024 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/js/customize-controls.dev.js | 3 +++ wp-includes/js/customize-base.dev.js | 2 ++ 2 files changed, 5 insertions(+) diff --git a/wp-admin/js/customize-controls.dev.js b/wp-admin/js/customize-controls.dev.js index a0e7dc51d7..449b564b2c 100644 --- a/wp-admin/js/customize-controls.dev.js +++ b/wp-admin/js/customize-controls.dev.js @@ -573,6 +573,9 @@ // Prevent the form from saving when enter is pressed. $('#customize-controls').on( 'keydown', function( e ) { + if ( $( e.target ).is('textarea') ) + return; + if ( 13 === e.which ) // Enter e.preventDefault(); }); diff --git a/wp-includes/js/customize-base.dev.js b/wp-includes/js/customize-base.dev.js index 7761c0799f..bbebc541aa 100644 --- a/wp-includes/js/customize-base.dev.js +++ b/wp-includes/js/customize-base.dev.js @@ -406,6 +406,8 @@ if ( typeof wp === 'undefined' ) synchronizer = api.Element.synchronizer[ type ]; if ( 'text' === type || 'password' === type ) this.events += ' keyup'; + } else if ( this.element.is('textarea') ) { + this.events += ' keyup'; } }