Skip to content

Commit

Permalink
Only report captions when entering and exiting them (#16445)
Browse files Browse the repository at this point in the history
Fixes #14874

Summary of the issue:
NVDA reports the word "caption" before every element in a figcaption element, or before each line in same when navigating by line in browse mode.

Description of user facing changes
NVDA now reports "caption" only when first entering a figure caption, and "out of caption" when leaving it.

Description of development approach
Changed textInfos.ControlField.getPresentationCategory to return PRESCAT_CONTAINER when its role is controlTypes.Role.CAPTION .
  • Loading branch information
SaschaCowley committed May 8, 2024
1 parent a0a2868 commit 6e99a50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/textInfos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def getPresentationCategory(
controlTypes.Role.TREEVIEW,
controlTypes.Role.CHECKMENUITEM,
controlTypes.Role.RADIOMENUITEM,
controlTypes.Role.CAPTION,
)
or (role == controlTypes.Role.EDITABLETEXT and controlTypes.State.MULTILINE not in states and (controlTypes.State.READONLY not in states or controlTypes.State.FOCUSABLE in states))
or (role == controlTypes.Role.LIST and controlTypes.State.READONLY not in states)
Expand Down Expand Up @@ -170,6 +169,7 @@ def getPresentationCategory(
controlTypes.Role.BLOCKQUOTE,
controlTypes.Role.GROUPING,
controlTypes.Role.FIGURE,
controlTypes.Role.CAPTION,
controlTypes.Role.REGION,
controlTypes.Role.FRAME,
controlTypes.Role.INTERNALFRAME,
Expand Down
1 change: 1 addition & 0 deletions user_docs/en/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Changes

* The fallback braille input table is now equal to the fallback output table, which is Unified English Braille Code grade 1. (#9863, @JulienCochuyt, @LeonarddeR)
* When reading by line in browse mode, "caption" is no longer reported on each line of a long figure or table caption. (#14874)

### Bug Fixes

Expand Down

0 comments on commit 6e99a50

Please sign in to comment.