From 2fe95dbb6760a8474c38c2954c8ca9430966eb08 Mon Sep 17 00:00:00 2001 From: Daniel Mircea Date: Mon, 24 Jun 2019 14:35:26 +0100 Subject: [PATCH] Fix initial input width --- js/bootstrap-tokenfield.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/bootstrap-tokenfield.js b/js/bootstrap-tokenfield.js index 5b2759d..79c7dae 100644 --- a/js/bootstrap-tokenfield.js +++ b/js/bootstrap-tokenfield.js @@ -161,7 +161,7 @@ this.$element.prependTo( this.$wrapper ) // Calculate inner input width - this.update() + setTimeout(this.update.bind(this), 0); // Create initial tokens, if any this.setTokens(this.options.tokens, false, ! this.$element.val() && this.options.tokens )