Options
All
  • Public
  • Public/Protected
  • All
Menu

Autocomplete.Interface

Represents the user interface which binds to the DOM.

The Interface class is designed to be consumed by an Autocomplete.Controller instance and should not be accessed directly unless absolutely necessary.

The main function of the Interface is to:

  • Present suggestions supplied by the controller
  • Provide callbacks to the controller for various user interactions
  • Provide methods to manipulate the user interface if required

Hierarchy

  • Interface

Index

Constructors

constructor

Methods

Private _onBlur

  • _onBlur(): void
  • Event handler: Fires when focus moves away from input field Triggers:

    • onBlur callback
    • Closes suggestion list

    Returns void

Private _onFocus

  • _onFocus(): void
  • Event handler: Fires when input field is focused Triggers:

    • onFocus callback
    • Refresh of suggestion list

    Returns void

Private _onInput

  • _onInput(event: Event): void
  • Event handler: Fires when input is detected on input fiel Triggers:

    • onInput callback

    Parameters

    • event: Event

    Returns void

Private _onKeyDown

  • _onKeyDown(event: KeyboardEvent): void
  • Event handler: Fires on "keyDown" event of search field Triggers:

    • select selection of address if key is "Enter"
    • onInput callback if key is "Backspace"
    • close closing of suggestion list if key is "Esc"
    • next highlight next suggestion if key is "Down"
    • previous highlight next suggestion if key is "Up"

    Parameters

    • event: KeyboardEvent

    Returns void

Private _onMousedown

  • _onMousedown(event: MouseEvent): void
  • Event handler: Fires when mousedown on <li> HTML Entity Triggers:

    • Selection of address suggestion

    Parameters

    • event: MouseEvent

    Returns void

close

Private detach

goto

Private initialiseCallbacks

Private initialiseEventListeners

  • initialiseEventListeners(options: any): Interface
  • Binds events from input and suggestion (ul) entities to private event handlers

    Parameters

    • options: any

    Returns Interface

Private initialiseInterface

next

open

opened

  • opened(): boolean

previous

refresh

scrollToView

select

selected

  • selected(): boolean

setMessage

  • Sets message as a list item, no or empty string removes any message

    Parameters

    • Optional message: string

    Returns Interface

setSuggestions