From ad650e283b63757487293a00ff8699b35ce15341 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 15 Mar 2014 05:13:23 +0000 Subject: [PATCH] Themes screens: Lose search input focus when pressing enter. This allows the keyboard to close on iOS, for example. props matveb. fixes #27233. git-svn-id: https://develop.svn.wordpress.org/trunk@27555 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/theme.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index a82b76ad44..a2e515471d 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -803,6 +803,11 @@ themes.view.Search = wp.Backbone.View.extend({ event.target.value = ''; } + // Lose input focus when pressing enter + if ( event.which === 13 ) { + this.$el.trigger( 'blur' ); + } + this.collection.doSearch( event.target.value ); // if search is initiated and key is not return