Skip to content

Problem with editable text fields which update their value when the focus changes #220

@nvaccessAuto

Description

@nvaccessAuto

Reported by jteh on 2008-11-05 14:58
Some web sites use a technique whereby they present the label of an editable text field in its value:

  • The value of the field defaults to the label.
  • When the field gains focus, the value is cleared.
  • When the field loses focus, if the value is empty, it is set back to the label.
    The practical upshot is that the field will contain its label if it is empty, but otherwise, it will show the value entered by the user. This is problematic for accessibility anyway, but nevertheless, several sites do this.

Unfortunately, this is particularly problematic for NVDA. NVDA sets the focus to fields as the user moves to them with the cursor keys or quick navigation. The resulting focus event is normally ignored because the virtual caret is already in the field, so NVDA knows that the focus change was caused by the caret movement. However, if a prior element on the page updates during the focus change (as is the case with this technique), the virtual caret will not be in the field because the field wil move in the buffer as a result of the focus change. Thus, NVDA will not ignore the focus event.

This is particularly bad if "Automatic focus mode for focus changes" is enabled because, upon receiving the focus event, NVDA will then activate focus mode, even though the user might have actually moved there using cursor keys or quick navigation.

Steps to Reproduce

  1. Ensure that "Automatic focus mode for focus changes" is enabled.
  2. Open the attached test case.
  3. Ensure you are at the top of the document by pressing ctrl+home.
  4. Press e twice to move to the second edit field.

Actual Results

Focus mode will be automatically enabled upon landing in the second edit field.

Expected Results

Focus mode should not be automatically enabled.

Additional Information

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions