From a3f2bdd6e45f2d4dff029661cd0a723e5bbc0fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=ABlie=20Amiot?= Date: Wed, 3 Jul 2013 18:45:56 +0200 Subject: [PATCH] Listento Keyup events to handle inputBox.resize --- lib/js/views/search_input.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/js/views/search_input.js b/lib/js/views/search_input.js index eb0e43f..3fc306d 100644 --- a/lib/js/views/search_input.js +++ b/lib/js/views/search_input.js @@ -13,6 +13,7 @@ VS.ui.SearchInput = Backbone.View.extend({ events : { 'keypress input' : 'keypress', 'keydown input' : 'keydown', + 'keyup input' : 'keyup', 'click input' : 'maybeTripleClick', 'dblclick input' : 'startTripleClickTimer' }, @@ -399,6 +400,11 @@ VS.ui.SearchInput = Backbone.View.extend({ view.setCursorAtEnd(-1); } + }, + + // We should get the value of an input should be done + // on keyup since keydown gets the previous value and not the current one + keyup : function(e) { this.box.trigger('resize.autogrow', e); }