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

Initialize auto select detection when focus returns to an editable text control from outside a browse mode document. #17503

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

jcsteh
Copy link
Contributor

@jcsteh jcsteh commented Dec 11, 2024

Link to issue number:

Fixes #17501.

Summary of the issue:

In web browsers, if you focus an editable text control, switch to browse mode, move focus out of the document (e.g. by switching applications) and then switch back to focus mode, changes to the text selection (e.g. shift+arrows) stop being reported.

Description of user facing changes

In web browsers, changes to text selection no longer sometimes fail to be reported in editable text controls.

Description of development approach

EditableTextWithAutoSelectDetection objects initialize auto select detection in event_gainFocus. However, when in browse mode, we deliberately ignore focus events when focus returns from outside the document. This means that event_gainFocus is never called and thus auto select detection is never initialized. The result is that when the user returns to focus mode with an editable text control focused, auto text selection isn't initialized and thus doesn't work at all.

We already handle this initialization in BrowseModeDocumentTreeInterceptor._postGainFocus for some cases. However, we previously weren't calling this when focus returned from outside the document. With this change, we do.

Note that initAutoSelectDetection is the only thing currently performed by _postGainFocus, via the override in the Gecko_ia2 vbuf.

Testing strategy:

Tested the steps to reproduce in #17501. Verified that the expected result occurs.

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

@jcsteh jcsteh requested a review from a team as a code owner December 11, 2024 11:17
@jcsteh jcsteh requested a review from seanbudd December 11, 2024 11:17
…xt control from outside a browse mode document.
@jcsteh
Copy link
Contributor Author

jcsteh commented Dec 11, 2024

I discovered a cleaner way to fix this, since it seems we were already handling this case elsewhere, so I updated the commit and the PR description accordingly.

@seanbudd seanbudd merged commit 8a82bd5 into nvaccess:master Dec 12, 2024
5 checks passed
@github-actions github-actions bot added this to the 2025.1 milestone Dec 12, 2024
@jcsteh jcsteh deleted the brokenSel branch December 16, 2024 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Text selection stops being reported in focus mode
2 participants