title: bootstrap tags input with typeahead throws (str || "").replace is not a function
body: <p>in my last question it turned out that typeahead.js was probably updated <a href="https://stackoverflow.com/questions/30942769/typeahead-autocomplete-suggestion-with-ajax-doesnt-work">typeahead autocomplete suggestion with ajax doesn't work</a>. on <a href="http://timschlechter.github.io/bootstrap-tagsinput/examples/" rel="nofollow noreferrer">bootstrap tags input</a> there are some examples, so based on some code from my first question and examples I came out with code below.
  When I type for example <code>s</code> I get autosuggestion with dropdown <code>Sandra</code> but when I click on it I get this error every time: 
  <code>Uncaught TypeError: (str || "").replace is not a function</code></p>
  
  <p>test.html</p>
  
  <pre><code>&lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"/&gt;
    &lt;link rel="stylesheet" href="/static/bootstrap.min.css"&gt;
    &lt;link rel="stylesheet" href="/static/bootstrap-theme.min.css"&gt;
    &lt;link rel="stylesheet" href="/static/bootstrap-tagsinput.css"&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;input type="text" data-role="tagsinput" &gt;
  
  &lt;script src="../static/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="../static/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;script src="../static/typeahead.bundle.js"&gt;&lt;/script&gt;
  &lt;script src="../static/bootstrap-tagsinput.js"&gt;&lt;/script&gt;
  
  
  &lt;script&gt;
  var citynames = new Bloodhound({
    datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'),
    queryTokenizer: Bloodhound.tokenizers.whitespace,
    remote: {
        url: '/test/?query=*',
        wildcard: '*',
        filter: function(x) {
              return $.map(x, function(item) {
                  console.log(item) //["Sandra"]
                  return {name: item};
              });
          },
      },
  });
  citynames.initialize();
  
  $('input').tagsinput({
    itemValue: 'name',
    typeaheadjs: {
      name: 'citynames',
      displayKey: 'name',
      source: citynames.ttAdapter()
    }
  });
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>app.py</p>
  
  <pre><code>from flask import Flask, render_template, url_for, jsonify, request
  
  app = Flask(__name__)
  
  @app.route('/', methods=['GET','POST'])
  def index():
      return render_template('test.html')
  
  @app.route('/test/', methods=['GET', 'POST'])
  def test():
      names = ["John","Jane", "Sandra", "Xerox"]
      query = request.args.get('query')
      return jsonify(options=[name for name in names if query.lower() in name.lower()])
  
  if __name__ == '__main__':
      app.run(debug = True)
  </code></pre>