Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-autocomplete-input

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-autocomplete-input

An autocomplete text input for Ember that manages common actions and handles keyboard interactions

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ember-cli-autocomplete-input

Build Status

An autocomplete text input for Ember.

  • It provides a hook for updating a list of results based on a change to the current term in the input field.
  • It also provides some basic keyboard navigation for quickly accessing items in the results list, including:
    • Enter key - select the currently highlighted result
    • Esc key - clear the search term and the current results
    • Up key - move the highlight to the result above the currently highlighted results
    • Down key - move the highlight to the result below the currently highlighted results

Installation

  • ember install ember-cli-autocomplete-input

Using the component

You can include the component in any of your templates:

{{autocomplete-input name=name results=results updateTerm="updateTerm" selectResult="selectResult"}}

Arguments

The autocomplete-input component takes the following arguments

name - String

The name variable will be set on the input tag as both the name attribute as well as the id attribute, allowing focus to be triggered by clicking a label tag.

results (required) - Array

The results array contains the current list of results objects.

resultName (optional, default 'name') - String

The attribute on an object in the results array that will be used as the display in the results list.

resultValue (optional, default 'value') - String

The attribute on an object in the results array that will be used to check a result to the currently highlighted result in the results list.

Handling interactions

The autocomplete-input component exposes the following actions which respond to user interaction:

selectResult(result)

This is fired when a result item is clicked or the enter key is pressed while a result is highlighted. The selected result is passed as the only argument.

updateTerm(term)

This is fired when the term is updated by typing into the bound input field. Use this action to update your results array.

clearSearch()

This is fired when the esc key is pressed. Use this action handle a clear of the search, ie clear results array and search term.

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 11 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc