From f1843cbb0bf36cfb55e5fc92dc06fa5885efa97e Mon Sep 17 00:00:00 2001 From: Illimar Tambek Date: Fri, 7 Mar 2014 14:42:07 +0200 Subject: [PATCH] Update input width when entering edit mode and clear mirror text when leaving edit mode --- js/bootstrap-tokenfield.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/bootstrap-tokenfield.js b/js/bootstrap-tokenfield.js index 9826b46..98902d2 100644 --- a/js/bootstrap-tokenfield.js +++ b/js/bootstrap-tokenfield.js @@ -803,6 +803,8 @@ .select() .data( 'edit', true ) .width( tokenWidth ) + + this.update(); } , unedit: function (focus) { @@ -810,6 +812,7 @@ $_input.appendTo( this.$wrapper ) this.$input.data('edit', false) + this.$mirror.text('') this.update()