Themes screens: Lose search input focus when pressing enter.

This allows the keyboard to close on iOS, for example.

props matveb.
fixes #27233.

Built from https://develop.svn.wordpress.org/trunk@27555


git-svn-id: http://core.svn.wordpress.org/trunk@27398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-03-15 05:14:15 +00:00
parent 5d77f8a18a
commit 0f32a52afa
2 changed files with 6 additions and 1 deletions

View File

@ -803,6 +803,11 @@ themes.view.Search = wp.Backbone.View.extend({
event.target.value = ''; event.target.value = '';
} }
// Lose input focus when pressing enter
if ( event.which === 13 ) {
this.$el.trigger( 'blur' );
}
this.collection.doSearch( event.target.value ); this.collection.doSearch( event.target.value );
// if search is initiated and key is not return // if search is initiated and key is not return

File diff suppressed because one or more lines are too long