Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scrolling to anchor links pointing to the object containing the virtual caret #17676

Merged
merged 7 commits into from
Feb 11, 2025

Conversation

nvdaes
Copy link
Collaborator

@nvdaes nvdaes commented Feb 5, 2025

  • Before scrolling in browse mode, check if the caret is in the first line of the object to be placed
  • Use Sphinx style to describe parameters
  • Update changelog

Link to issue number:

Fixes #17669

Summary of the issue:

When anchor links point to the objec where the virtual caret is placed, NVDA doesn't scroll to the link destination.

Description of user facing changes

NVDA Will scroll to destination of anchor links, even where they point to the object where the virtual caret is placed.

Description of development approach

In the _handleScrollTo function of source/browseMode.py, we check if the caret is placed in the same line as the anchor link destination, instead of checking if it's in the same object.
This has been explained and suggested by @jcsteh in #17669.

Testing strategy: placed in the same object.

Tested with Firefox on Windows 11, and with Chrome and Edge, with and without UIA enabled, using the demo provided in #17669

Known issues with pull request:

None

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@coderabbitai summary

@nvdaes nvdaes changed the title fixBrowseModeScrollingToStart Fix scrolling to anchor links pointing to the object containing the virtual caret Feb 5, 2025
@nvdaes nvdaes marked this pull request as ready for review February 6, 2025 04:47
@nvdaes nvdaes requested a review from a team as a code owner February 6, 2025 04:47
@nvdaes nvdaes requested a review from seanbudd February 6, 2025 04:47
@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Feb 10, 2025
@seanbudd seanbudd merged commit e2d464f into nvaccess:master Feb 11, 2025
5 checks passed
@github-actions github-actions bot added this to the 2025.1 milestone Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Links to anchors in web pages are broken if the link points to a parent element
2 participants