Releases: frikinside/vue3-simple-typeahead
v1.0.11
Added new prop minItemLength
form the work of @oldpatricka #20
The minItemLength determines how many items must remain before the suggestion window is hidden. The existing code only hides the suggestion list once no items match, but I would like the option to hide the list when only one item matches. This prop enables this, but doesn't change the existing default behaviour.
Prop | Type | Default | Description |
---|---|---|---|
minItemLength |
Number | 0 | Minimum number of items that need to be visible for suggestions to appear, the prop value has to be >= 0 |
Remember you can always use lower-kebap-case for camelCase props like min-item-length
v1.0.10
Added a new prop selectOnTab
.
Prop | Type | Default | Description |
---|---|---|---|
selectOnTab |
Boolean | true |
Enable/Disable item selection on TAB |
If you set it a false
it would not select the item on TAB
v1.0.9
Added methods accesible by refs to play with the input control.
Method | Signature | Description |
---|---|---|
clearInput |
function (): void |
Clean the input with an empty string '' |
focusInput |
function (): void |
Trigger focus on the input and called onFocus event handler |
blurInput |
function (): void |
Trigger blur on the input and called onBlur event handler |
getInput |
function (): HTMLInputElement |
Return the HTMLInputElement corresponding to the input control |
Use this methods using the ref on the component:
<vue3-simple-typeahead ref="inputRef"> </vue3-simple-typeahead>
{
this.$refs.inputRef;
}
In code, this.$refs.inputRef
would have access to the methods above.
v1.0.7
Added support for fallthrough attributes
Fallthrough attributes
All attributes added to the component not provided by props fallthrough the input control.
For example if you added the disabled
attribute:
<vue3-simple-typeahead
id="typeahead_id"
placeholder="Start writing..."
:items="['One','Two','Three']"
:minInputLength="1"
:itemProjection="itemProjectionFunction"
@selectItem="selectItemEventHandler"
@onInput="onInputEventHandler"
@onFocus="onFocusEventHandler"
@onBlur="onBlurEventHandler"
:disabled="disabled"
>
</vue3-simple-typeahead>
It would fallthrough to the input control of the component:
<!---->
<input [...] :disabled="disabled" />
<!---->
v1.0.5
Added a defaultItem
prop to preselect an item from the list.
v1.0.4
Added class simple-typeahead-input
to the input control element.
Add slots to provide further customization:
Slot | Parent | Props | Description |
---|---|---|---|
#list-header |
div.simple-typeahead-list-header |
Slot to be show at top of the suggestion list | |
#list-item-text |
span.simple-typeahead-list-item-text' |
item , itemProjection , boldMatchText |
Slot to customize the text of every item in the suggestion list |
#list-footer |
div.simple-typeahead-list-footer |
Slot to be show at bottom of the suggestion list |
v1.0.2
Remove browser autocomplete.
v1.0.1
First release for the component.
It has all the basic functionality to be production ready.