Git Product home page Git Product logo

Comments (6)

nnavnyko avatar nnavnyko commented on July 22, 2024 5

I had a problem when i was using Bootstrap Tagsinput and Typehead.js. By default Tagsinput has property addOnBlur = true, but typehead override this. Resolution is something like this:

  //tags is a Bloodhound object. see http://timschlechter.github.io/bootstrap-tagsinput/examples/ 
  //about Typehead. There is the same problem, you can try to enter some string and blur

    $('input').tagsinput({
          typeaheadjs: {
            name: 'tags',
            displayKey: 'val',
            valueKey: 'val',
            source: tags.ttAdapter()
          }
    });
    $('input').tagsinput('input').blur(function() {
        $('input').tagsinput('add', $(this).val());
        $(this).val('');
    })

In this order. I'm sorry for my english, it's not good :)

from bootstrap-templates.

gkorland avatar gkorland commented on July 22, 2024

+1 (thanks for the workaround)

from bootstrap-templates.

cygnil avatar cygnil commented on July 22, 2024

Definitely +1 for this

from bootstrap-templates.

dkonayuki avatar dkonayuki commented on July 22, 2024

+1 nicely done

from bootstrap-templates.

tim-peterson avatar tim-peterson commented on July 22, 2024

addOnBlur should be noted in the documentation as an option.

from bootstrap-templates.

nezirz avatar nezirz commented on July 22, 2024

This worked in my case solution from @itsprdp here:
"https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/236"

A better way to clear the typeahead input after adding the tag.

self.$input.typeahead('val', '');

Add this line to the end of the add() function after line number 149 in the src file https://github.com/TimSchlechter/bootstrap-tagsinput/blob/master/src/bootstrap-tagsinput.js

Ref: twitter/typeahead.js#233

from bootstrap-templates.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.