question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

autocomplete feature

See original GitHub issue

What will it allow you to do that you can’t do today? Allow for a custom autocomplete feature with fluid form control and server-side processing options

How will it make current work-arounds straightforward? The current autoselect is very select focused, and somewhat clumpy to use as an ‘autocomplete’ feature

What potential bugs and edge cases does it help to avoid? un sure

i have forked and branched an autocomplete feature as mentioned in #835.

https://github.com/lgullestrup/vuetify/tree/feature/autocomplete

I have designed this component to be more fluid in forms, and flexible in use, allowing for both server-side processing and client-side processing. The component is only responsible for the display and selection of results, and selected value (filtering included if not using service-side).

The component is based on the existing v-select component, how ever, modified to incorporate true ‘autocomplete’ feature. I also had implement a custom ‘v-menu’ for the autocomplete to facilitate more fluid keyboard commands and interactions.

there a still a couple of small bugs i am working on, but i thought i would put this up anyway. Current known bug is the duplication’s of the strict value in the menu, cause but at line 79 of autocomplete.js also yet to adjust the up and down arrow keys to allow for cycling of selections.

Also, i have not yet gone through and removed properties which arn’t needed. apart from ‘autocomplete’, and ‘multiple’

Added Properties: strict: Boolean/String (default: false) —If set, this property will enforce a selection from the menu. If a string is provided, the provided string will be added to the bottom of the menu. If no selection is made, then the field remains blank. the last list item created with the strict value will contain a ‘generatedItem’ property set to ‘true’ When set to true with a default item value, the first item in the menu will be highlighted when searching.

server-side: Boolean (default: false) —If true, will display the array of items as provided (unless strict has a string value), relying on the server to provided a filtered list.

‘:search.sync’ This is required if you are running server side processing. it allows you to get the current searchValue.

Events selected: this event is fired when a selection is made, and will provided the selected item. This is useful if your item contains more information for other fields

Keyboard Commands: Typing will automatically activate the autocomplete functionality. Tab will select any highlighted value. If not value is highlisted and input is not strict, the searchvalue will be set as the inputvalue. If strict and there is no Default strict eg.‘Unknown’, then no value will be set.

example use:

<v-autocomplete :items="list" 
    v-model="fieldValue" 
    :search.sync="search"
     label="Suburb" item-text="suburb" 
    item-value="suburb" 
    @selected="handleSelected"
     strict="Unknown">
<template slot="item" scope="data">
      <v-list-tile-content>
        <v-list-tile-title>{{data.item.suburb}}</v-list-tile-title>
        <template v-if="!data.item.generatedItem">
          <v-list-tile-sub-title>{{data.item.postcode}} - {{data.item.state}}</v-list-tile-sub-title>
        </template>
      </v-list-tile-content>
    </template>
</v-autocomplete

image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:21
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
gabrielmirandatcommented, Sep 6, 2017

It would be interesting to the autocomplete be invariant to accents, as some languages has accents. One example is if I search for “Camara” suggest itens like “Câmara”, “CAMARA”, “CÂMARA”…

1reaction
johnleidercommented, Aug 19, 2017

This has been implemented with the exception of the tagging like system, and the duplication handling of that will be resolved with #1413

Read more comments on GitHub >

github_iconTop Results From Across the Web

How Google autocomplete predictions work
Autocomplete is a feature within Google Search that makes it faster to complete searches that you start to type. Our automated systems generate...
Read more >
How Google autocomplete works in Search
Autocomplete is a feature within Google Search designed to make it faster to complete searches that you're beginning to type.
Read more >
HTML attribute: autocomplete - MDN Web Docs
The HTML autocomplete attribute lets web developers specify what if any permission the user agent has to provide automated assistance in ...
Read more >
What is Autocomplete? - Computer Hope
Alternatively referred to as word completion, autocomplete is a software feature that suggests finishing what is being typed by comparing ...
Read more >
How Autocomplete works on Google Search - YouTube
Autocomplete is a feature within Google Search designed to make it faster to complete searches you're beginning to type.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found