Giter VIP home page Giter VIP logo

Comments (2)

 avatar commented on August 19, 2024

I had that issue, I set the limit to zero initially and then when someone types I change limit to 4. Sorta acts as a disable initially and reenable when someone types.

<div class="col-xs-5" v-on:keyup="enableTypeahead">
            <label for = "name">Style</label>              
            <typeahead                 
                v-model="beer.style.stylename"
                placeholder="Style" 
                async-key="data" 
                :async="getAsyncStyleUrl" 
                :template="asyncStyleTemplate" 
                :on-hit="callBackStyle"
                :limit="typeaheadLimit">
            </typeahead>             
        </div>
data (){
        return {
            asyncStyleTemplate: '{{ item.stylename }}',
            typeaheadLimit: 0
        }
    }
enableTypeahead() {
            this.typeaheadLimit = 4;
        }

from vue-strap.

Pengman avatar Pengman commented on August 19, 2024

Nice workaround @tehjrow

I made it work by alterring the source (in Typeahead.vue, or the js created from it):
I added a prop to the component ( around line 35 ):

    matchStart: { type: Boolean, default: false },
    supressInitialSearch: { type: Boolean, default: false }, // added
    onHit: {

And then I changedf the created hook to respect this property (around line 125)

      if (! this.supressInitialSearch) {
          this.__update();
      }

And now the property can be added to the typeaheads when needed:

                <typeahead 
                           supress-initial-search
                           :on-hit="...">

This seems to work for me, to prevent the initial search and popup

from vue-strap.

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.