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

CU - Streamline useIsScreenReaderEnabled hook and update doc #5057

Closed
TimRoe opened this issue Mar 9, 2023 · 2 comments
Closed

CU - Streamline useIsScreenReaderEnabled hook and update doc #5057

TimRoe opened this issue Mar 9, 2023 · 2 comments
Assignees
Labels
code upkeep front-end Ticket requires front-end work global Issues for the global team

Comments

@TimRoe
Copy link
Contributor

TimRoe commented Mar 9, 2023

Proposed Change

The useIsScreenReaderEnabled function in hooks.tsx was updated for a needed adjustment on short notice for the Nav project going out in a manner that ensured consistent behavior for preexisting functionality with potentially unnecessary safeguards on ticket #5047. This issue is to check if the potentially unnecessary safeguards can be removed (it is believed they can) without breaking existing use cases.

The specific aims of this code upkeep are:

  1. Check if the two other hooks that leverage useIsScreenReaderEnabled still work as desired when withListener argument is removed and the function is always adding a listener (will reflect the update immediately when screen reader status is changed on/off, instead of only checking once at render time)
  2. Investigate if the isMounted variable needs to exist anymore either after always using the listener, remove if it doesn't
  3. Update the documentation (documentation/docs/Engineering/FrontEnd/CustomHooks/useIsScreenReaderEnabled.mdx) to match after-this-ticket functionality and document the additional example variety added with spike/5010-roettger-ScreenReaderResponsiveTransitionHeader #5047 and any others in the interim

Why Should We Prioritize?

Would greatly streamline this hook's functionality to be clear, concise, and efficient; potentially function better than it does now for existing use cases; and should be a fairly small lift.

@TimRoe TimRoe added code upkeep front-end Ticket requires front-end work labels Mar 9, 2023
@timwright12 timwright12 added the global Issues for the global team label Dec 11, 2023
@alexandec alexandec self-assigned this Dec 5, 2024
@alexandec
Copy link
Contributor

alexandec commented Dec 9, 2024

Note for QA, check usage of useIsScreenReaderEnabled for regressions:

  • CategoryLandingTemplate
  • FeatureLandingAndChildTemplate
  • HeaderBanner
  • CollapsibleMessage
  • useAutoScrollToElement (AlertWithHaptics, ClaimPhase)
  • useAccessibilityFocus (BackButton, SnackBar, HeaderBanner, GenericOnboarding)

@rbontrager rbontrager self-assigned this Dec 11, 2024
@rbontrager
Copy link
Contributor

Verified that the functionality in the app when useIsScreenReaderEnabled is true works as expected for the items listed above. Approved by QA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code upkeep front-end Ticket requires front-end work global Issues for the global team
Projects
None yet
Development

No branches or pull requests

5 participants