Skip to content

Spin button pattern home and end guidance conflicts with basic editing functionality #3377

@mcking65

Description

@mcking65

Background

The Keyboard Interaction section of the Spin Button Pattern specifies functionality for the 'Home' and 'End' keys that conflict with the guidance to support standard single-line editing keys.

Guidance for 'Home' and 'End' is:

  • Home: If the spinbutton has a minimum value, sets the value to its minimum.
  • End: If the spinbutton has a maximum value, sets the value to its maximum.

With respect to editing, the guidance includes:

  • If the spinbutton text field allows directly editing the value, the following keys are supported:
    • Standard single line text editing keys appropriate for the device platform (see note below).
    • Printable Characters: Type characters in the textbox.

Note 2 defines single-line editing key support:

Standard single line text editing keys appropriate for the device platform:

  1. include keys for input, cursor movement, selection, and text manipulation.
  2. Standard key assignments for editing functions depend on the device operating system.
  3. The most robust approach for providing text editing functions is to rely on browsers, which supply them for HTML inputs with type text and for elements with the contenteditable HTML attribute.
  4. IMPORTANT: Be sure that JavaScript does not interfere with browser-provided text editing functions by capturing key events for the keys used to perform them.

The problem

'Home' and 'End are intended to move the cursor to the beginning and end of the input. Screen readers expect that behavior because the type is an editable input. So, co-opting 'Home' and ''End' for min and max value input is counter to note 2.4 and interferes with single-line text editing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions