summaryrefslogtreecommitdiffstats
path: root/test/api/selectSpec.js
Commit message (Collapse)AuthorAgeFilesLines
* Consistent quotes styleVladislav Zarakovsky2016-06-241-1/+1
|
* Emit close reason with awesomplete-close eventsJim Fitzpatrick2016-06-221-1/+3
| | | | | | | | | Emit a reason when firing `awesomplete-close` events to provide transparency to attached event listeners regarding the circumstance in which the close was triggered. Reasons include `blur`, `esc`, `submit`, `select`, and `nomatches`. Closes #16897
* Pass suggestion item to awesomplete-selectcomplete and awesomplete-highlight ↵Vladislav Zarakovsky2016-03-131-1/+5
| | | | events
* Remove redundant evt.data, it's same at evt.textVladislav Zarakovsky2016-03-121-1/+0
| | | | Agreed in https://github.com/LeaVerou/awesomplete/issues/16821#issuecomment-185901377
* Separate label/value for each suggestion on the list.Vladislav Zarakovsky2016-03-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is now possible to show a suggestion label in completer, but insert a suggestion value into the input instead. In addition to String as before, each list item now can also be: - a `{ label, value }` Object - a `[ label, value ]` Array To show full country name in completer, but insert country code into the input you can use these items: - `{ label: "United States", value: "US" }` - `[ "United States", "US" ]` Despite this data format change, old code will continue to work as before. This is taken care by `Suggestion()`. It uses `label` property automatically when string is expected anywhere in the API. One known issue is that accessing suggestion's characters by index won't work with old API. It's easy to fix though. Instead of `item[idx]` use `item.value[idx]` or `item.label[idx]` directly. In addition to default support for String/Object/Array items, we also add `data` method, which can be used to support any additional custom item formats and to generate data dynamically, as in changed Email example. The only thing you need to do in this case is to return item in any of String/Array/Object formats supported by default.
* Revert "Changed event property name: origin -> originalTarget"Vladislav Zarakovsky2016-02-171-1/+1
| | | | This reverts commit 1f86aaf981910686e11ffea47c24c8838a17d7d8.
* Changed event property name: origin -> originalTargetVladislav Zarakovsky2016-02-071-1/+1
|
* Add item data to awesomplete-select eventVladislav Zarakovsky2016-02-011-0/+1
|
* Big tests cleanupVladislav Zarakovsky2016-01-281-3/+7
|
* Simplify tests by inlining and using $.spyOnEvent helperVladislav Zarakovsky2015-11-251-20/+12
|
* awesomplete.select testsVladislav Zarakovsky2015-11-241-0/+130