# cbenni-tabcomplete

> JQuery plug in for tab-completing text.

Latest version **1.2.0** (published 2015-05-18) · 0 weekly downloads

## Install

```sh
npm install cbenni-tabcomplete
pnpm add cbenni-tabcomplete
yarn add cbenni-tabcomplete
bun add cbenni-tabcomplete
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2015-05-18 |
| First published | 2015-05-10 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | CBenni |
| Maintainers | cbenni |
| Keywords | jquery-plugin, complete, widget, ecosystem:jquery-ui, ecosystem:jquery |

## Links

- npm: https://www.npmjs.com/package/cbenni-tabcomplete
- Repository: https://github.com/CBenni/tabcomplete
- Issues: https://github.com/CBenni/tabcomplete/issues
- npm.io page: https://npm.io/package/cbenni-tabcomplete

## Dependencies (3)

- [jquery](https://npm.io/package/jquery.md) >=1.5
- [jquery-ui](https://npm.io/package/jquery-ui.md) >=1.8
- [jquery-caret](https://npm.io/package/jquery-caret.md) >=1.3

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2015-05-18
- 1.1.1 — 2015-05-10
- 1.1.0 — 2015-05-10
- 1.0.2 — 2015-05-10
- 1.0.1 — 2015-05-10

## README

# tabcomplete #
JQuery plugin for tab-completing text, for example for usernames in a chat window.

## Usage ##

    $(selector).tabcomplete(options);
	
where `options` contains only one element, `collection`, which can either be an array of strings or a `function(word)` returning an array based on a word (the word the cursor was located at when the user pressed tab). Supports all input types supported by caret.js

Note: the values are not cached by tabcomplete.js - if you load values via ajax or similar, caching will be left to you.

## Examples ##

	$("textarea").tabcomplete({collection: ["some user",
											"some user1",
											"someuser2",
											"someuser3",
											"some user4",
											"some user5",
											"another user",
											"another user24"]});

If the `collection` is an array, as seen above, it will suggest only entries that start with the word the caret is at. This filtering is not applied to  `collection: function(word)`, as seen below. Suggestions are cycled respecting the order in which the items appear in the collection, therefore a deterministic order is suggested.

	allusers = ["some user",
				"some user1",
				"someuser2",
				"someuser3",
				"some user4",
				"some user5",
				"another user",
				"another user24"];
	$("textarea").tabcomplete({collection: function(word)
		{
			// return the array items that start with the word
			return allusers.filter(function(v){return v.indexOf(word)==0;});
		}
	});
	

Live demo: http://codepen.io/anon/pen/KpVZmz

---
_Source: https://npm.io/package/cbenni-tabcomplete · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
