AbstractInputSuggest
Attach to an <input>
element or a <div contentEditable>
to add type-ahead
support.
Extends
Type Parameters
• T
Constructors
new AbstractInputSuggest()
new AbstractInputSuggest<
T
>(app
,textInputEl
):AbstractInputSuggest
<T
>
Accepts an <input>
text box or a contenteditable div.
Parameters
• app: App
• textInputEl: HTMLDivElement
| HTMLInputElement
Returns
Overrides
Properties
app
app:
App
Inherited from
isOpen
isOpen:
boolean
Whether the suggestion popup is currently open and visible
Inherited from
limit
limit:
number
Limit to the number of elements rendered at once. Set to 0 to disable. Defaults to 100.
scope
scope:
Scope
Inherited from
suggestEl
suggestEl:
HTMLElement
Suggestion container element
Inherited from
suggestions
suggestions:
SuggestionContainer
<T
>
Handles selection and rendering of the suggestions
Inherited from
Methods
close()
close():
void
Returns
void
Inherited from
getSuggestions()
abstract
getSuggestions(query
):T
[] |Promise
<T
[]>
Parameters
• query: string
Returns
T
[] | Promise
<T
[]>
getValue()
getValue():
string
Gets the value from the input element.
Returns
string
onSelect()
onSelect(
callback
):this
Registers a callback to handle when a suggestion is selected by the user.
Parameters
• callback
Returns
this
open()
open():
void
Returns
void
Inherited from
renderSuggestion()
abstract
renderSuggestion(value
,el
):void
Render the suggestion item into DOM.
Parameters
• value: T
• el: HTMLElement
Returns
void
Inherited from
PopoverSuggest
.renderSuggestion
selectSuggestion()
selectSuggestion(
value
,evt
):void
Parameters
• value: T
• evt: MouseEvent
| KeyboardEvent
Returns
void
Overrides
PopoverSuggest
.selectSuggestion
setValue()
setValue(
value
):void
Sets the value into the input element.
Parameters
• value: string
Returns
void