Skip to content

igxAutocomplete Specification

Nikolay Alipiev edited this page Jan 24, 2019 · 19 revisions

Revision history

Version Author Date Notes
0.1 Radoslav Karaivanov 2019-01-08 Initial Draft
0.2 Nikolay Alipiev 2019-01-17 Test scenarios and igxAutocompleteHighlightMatch
0.3 Nikolay Alipiev 2019-01-17 Assumptions and Limitations & References sections
0.4 Nikolay Alipiev 2019-01-24 Update entire specification with new requirements

Overview

The igxAutocomplete directive provides a way to enhance a text input by showing a panel of suggested options provided by the developer.

The simplest use-case for an end-user should be attaching the directive to an input element and providing to a template for the panel.

Example:

<input type="text" [igxAutocomplete]="townsPanel" />
<igx-drop-down #townsPanel>
    <igx-drop-down-item *ngFor="let town of towns | startsWith:townSelected" [value]="town">
        {{town}}
    </igx-drop-down-item>
</igx-drop-down>

Acceptance criteria

  1. Pass an template for the panel that will act as an autocompletion drop down.
  2. Keyboard navigation both inside the drop down panel and the text input while keeping the focus inside the text input.
  3. Selection; with mouse/touch and keyboard.
  4. Compatibility support

User Stories

Developer

As a developer, I want to be able to:

  1. provide my own template for the items in the suggestion panel.
  2. control and modify where and how is the panel rendered.
  3. listen to and react when a end-user selects an item from the panel.
  4. Enable and disable dynamically the autocomplete panel

End-User

  1. Open autocomplete panel when start typing in the input.
  2. Auto selection of the first item, so that it is easily selected with Enter key.
  3. Keyboard navigation both inside the drop down panel and the text input while keeping the focus inside the text input.
  4. Selection; with mouse/touch and keyboard.
  5. Default width of the autocomplete panel should map input or its parent group container.
  6. Closing the panel using ECS, TAB or loosing focus of the input.
  7. Compatibility support
  8. Disable browser default autofill

Functionality

  • TBD

Test Scenarios

  • Drop down opening

    • Do not open when input is focused
    • Do not open when igxAutocompleteDisabled is true
    • Open when start typing in the input
    • Do not open browsers' autofill drop down
  • Drop down closing

    • Blur
    • ESC
    • Select item with click or ENTER
    • When disabled is set to true dynamically
  • Drop down navigation

    • Navigate through items with Arrow Up/Down
    • Auto highlight first match when panel is opened
  • Item selection

    • Update model on item selection with Enter key or mouse click
  • Panel settings

    • Use different positioning of the autocomplete
  • Input properties and Output events

  • ARIA

  • Textarea

  • Integration with other components

WAI-ARIA Considerations

Please follow the guidelines for a combo with a listbox popup defined here.

API

Output events

Open for consideration

  • onItemSelected: a cancelable event which is emitted when a selection is made through mouse/touch/keyboard interaction.

Input properties

Open for consideration

  • igxAutocomplete: an array of objects acting as a "data source" for the suggestion panel.
  • igxAutocompleteSettings: OverlaySettings to be applied when rendering the suggestion panel.
  • igxAutocompleteDisabled: Enable/disable the directive. Does not affect the host component/element.

Methods

  • open - open autocomplete panel
  • close - close autocomplete panel
  • igxAutocompleteSettings will be limited to positioning strategy settings

igxAutocomplete issue

Angular Material Autocomplete

ARIA 1.1 Combobox role and ARIA 1.1 Combobox with Listbox Popup Examples

Clone this wiki locally