Ticket #220 (assigned defect)
Problem with editable text fields which update their value when the focus changes
| Reported by: | jteh | Owned by: | mdcurran |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | Virtual buffers | Version: | trunk |
| Keywords: | Cc: | ||
| Blocking: | Blocked By: |
Description
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
- Ensure that "Automatic focus mode for focus changes" is enabled.
- Open the attached test case.
- Ensure you are at the top of the document by pressing ctrl+home.
- 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.

NVDA is supported by