Options
All
  • Public
  • Public/Protected
  • All
Menu

Options supported by View

Hierarchy

  • ViewOptions

Index

Properties

aria

aria: "1.0" | "1.1"

Configures which WAI-ARIA specification version Address Finder should target.

  • "1.1" will target the most recent spec
  • "1.0" will enable some regressions to support the 1.0 spec.

Although 1.1 was released in 2017, this currently defaults to "1.0" as it receives the widest support among screen readers. VoiceOver (for MacOS and iOS) and NVDA in particular benefit from this.

Defaults to "1.0"

autocomplete

autocomplete: string

Sets the autocomplete attribute of the input field to prevent Chrome's autofill from clashing

containerClass

containerClass: string

CSS class assigned to the AddressFinder container/wrapper

Defaults to "idpc_autocomplete"

containerStyle

containerStyle: Partial<Record<number | keyof CSSStyleDeclaration, string>>

Applies additional styling to the the Address Finder container element. Accepts CSSStyleDeclaration object

default

{}

example
{
  containerStyle: {
    backgroundColor: "#000",
  },
}

document

document: Document

Specify the Document to operate on

default

window.document

hide

hide: (string | HTMLElement)[]

Hide a list of HTML elements when Postcode Lookup is instantiated

Specify these elements using query selectors or direct HTMLElement references

default

[]

inputField

inputField: SelectorNode

CSS selector or HTML Element which specifies the <input> field which the Address Finder View should bind.

inputStyle

inputStyle: Partial<Record<number | keyof CSSStyleDeclaration, string>>

Applies additional styling to the input field. Ideal for quick tweaks. Accepts CSSStyleDeclaration object Input styles are restored to original when controller is detached from DOM

default

{}

example
{
  inputStyle: {
    backgroundColor: "#000",
  },
}

liStyle

liStyle: Partial<Record<number | keyof CSSStyleDeclaration, string>>

Applies additional styling to the the Address Finder list element. Accepts CSSStyleDeclaration object

default

{}

example
{
  liStyle: {
    backgroundColor: "#000",
  },
}

listClass

listClass: string

CSS class assigned to suggestion list (bound to <ul>)

Defaults to "idpc_ul"

listStyle

listStyle: Partial<Record<number | keyof CSSStyleDeclaration, string>>

Applies additional styling to the the suggestion list. Accepts CSSStyleDeclaration object

default

{}

example
{
  listStyle: {
    backgroundColor: "#000",
  },
}

messageClass

messageClass: string

CSS class assigned to message box

Defaults to "idpc_error"

Note this doesn't necessarily indicate an error

msgInitial

msgInitial: string

Initial message when Address Finder opens an no query is available

Defaults to "Start typing to find address"

msgList

msgList: string

Aria-label attached to the suggestion list. Prompts screen reader user on how to operate list

Defaults to "Select your address"

msgNoMatch

msgNoMatch: string

Message to present when no match found

msgUnhide

msgUnhide: string

Message shown to user to unhide address fields if hide attribute is configured

default

"Enter address manually"

onBlur

onBlur: OnBlur

Invoked when the user unfocuses from the address input field.

onClose

onClose: OnClose

Invoked when Address Finder suggestion box is closed (i.e. hidden from user).

onFocus

onFocus: OnFocus

Invoked when user selects or focuses address input field.

onInput

onInput: OnInput

Invoked when input is detected on address input field.

onKeyDown

onKeyDown: OnKeyDown

Invoked when keypress is triggerd on input

onMounted

onMounted: OnMounted

Invoked when controller is attached to DOM

onMouseDown

onMouseDown: OnMouseDown

Invoked when mousedown event is triggered on suggestion list

onOpen

onOpen: OnOpen

Invoked when Address Finder suggestion box is opened (i.e. presented to the user).

onRemove

onRemove: OnRemove

Invoked when controller is detached from DOM

onSelect

onSelect: OnSelect

Invoked when an address suggestion in suggestion box is selected.

onUnhide

onUnhide: OnUnhide

Invoked when hidden fields are unhidden (i.e. user selects an address or options to manually insert address)

scope

scope: HTMLElement | Document

Scopes the operable area of the DOM

default

window.document

unhide

unhide: null | string | HTMLElement

Specify a clickable element to unhide elements hidden with hide

default

null

unhideClass

unhideClass: string

Class of clickable unhide element

default

"idpc-unhide"