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

Focus on main when content changes #2221

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

RoyEJohnson
Copy link
Contributor

@RoyEJohnson RoyEJohnson commented Apr 12, 2024

@RoyEJohnson RoyEJohnson requested a review from a team as a code owner April 12, 2024 14:51
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-chctpn April 12, 2024 14:51 Inactive
Copy link

sentry-io bot commented Apr 12, 2024

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: src/app/content/components/Page/scrollToTopOrHashManager.ts

Function Unhandled Issue
scrollToTop TypeError: Cannot read properties of null (reading 'tabIndex') resetTabIndex(rex/releases/v4/aff2e9c/static...
Event Count: 1 Affected Users: 4

Did you find this useful? React with a 👍 or 👎

Copy link
Member

@Dantemss Dantemss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like in principle it should work

src/app/components/MainContent.tsx Outdated Show resolved Hide resolved
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-chctpn April 16, 2024 19:17 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-chctpn April 19, 2024 17:29 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-chctpn April 22, 2024 16:22 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-chctpn April 23, 2024 14:51 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-chctpn April 23, 2024 16:40 Inactive
@Malar-Natarajan Malar-Natarajan temporarily deployed to rex-web-focus-on-main-w-6dwn7k April 30, 2024 19:13 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-6dwn7k May 1, 2024 19:01 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-6dwn7k May 2, 2024 19:35 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-6dwn7k May 2, 2024 20:51 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-6dwn7k May 2, 2024 21:31 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-6dwn7k May 3, 2024 14:32 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-6dwn7k May 3, 2024 14:33 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-6dwn7k May 6, 2024 18:57 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-6dwn7k May 6, 2024 21:44 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-6dwn7k May 7, 2024 20:34 Inactive
@RoyEJohnson RoyEJohnson force-pushed the focus-on-main-when-content-updates branch from 4881908 to a052faa Compare May 14, 2024 20:11
@RoyEJohnson RoyEJohnson force-pushed the focus-on-main-when-content-updates branch 2 times, most recently from 0c53803 to a6f8511 Compare June 5, 2024 15:01
@Malar-Natarajan Malar-Natarajan temporarily deployed to rex-web-focus-on-main-w-ygl64e June 26, 2024 16:08 Inactive
@Malar-Natarajan
Copy link
Contributor

@RoyEJohnson The CI check Test is failing. Could you please have a look.

@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-ygl64e June 26, 2024 19:27 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-ygl64e June 27, 2024 17:01 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-ygl64e June 27, 2024 17:24 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-ygl64e June 27, 2024 17:52 Inactive
@RoyEJohnson RoyEJohnson force-pushed the focus-on-main-when-content-updates branch from 33cdd33 to da7eaad Compare June 28, 2024 12:12
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-arl983 November 13, 2024 22:43 Inactive
Copy link
Member

@TomWoodward TomWoodward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic is looking cleaner now, although now that i'm looking at where you changed the code in scrollToTargetOrTop i'm wondering if it would be best to focus the target instead of the whole content when linking to a specific target

@TomWoodward
Copy link
Member

also that built CI check needs to be fixed

@RoyEJohnson RoyEJohnson force-pushed the focus-on-main-when-content-updates branch from 592d0ac to 47251c8 Compare November 14, 2024 19:16
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-arl983 November 14, 2024 19:16 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-arl983 November 14, 2024 19:51 Inactive
@RoyEJohnson RoyEJohnson force-pushed the focus-on-main-when-content-updates branch from b5e1c56 to a39ed17 Compare November 14, 2024 19:59
@TomWoodward TomWoodward had a problem deploying to rex-web-focus-on-main-w-arl983 November 14, 2024 19:59 Failure
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-arl983 November 14, 2024 20:47 Inactive
@RoyEJohnson
Copy link
Contributor Author

Some scroll-to targets are not focusable. Footnotes, for example, are simply divs. They have id's so you can scroll to them, but no tabindex, so they don't focus.

@TomWoodward
Copy link
Member

i wonder what the intended screen reader functionality is there.... surely if its scrolling to a target on the page its not supposed to start reading from the top of the content

@RoyEJohnson RoyEJohnson force-pushed the focus-on-main-when-content-updates branch from 4a9e6e7 to 9fc4548 Compare November 14, 2024 20:57
@TomWoodward TomWoodward had a problem deploying to rex-web-focus-on-main-w-arl983 November 14, 2024 20:57 Failure
@RoyEJohnson RoyEJohnson force-pushed the focus-on-main-when-content-updates branch from 9fc4548 to a4dd422 Compare November 14, 2024 21:06
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-arl983 November 14, 2024 21:06 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-arl983 November 14, 2024 21:18 Inactive
@RoyEJohnson RoyEJohnson force-pushed the focus-on-main-when-content-updates branch from 9ff533c to a251118 Compare November 14, 2024 21:26
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-main-w-arl983 November 14, 2024 21:26 Inactive
@RoyEJohnson
Copy link
Contributor Author

It would be reasonable for screenreaders to recognize that content has scrolled and start reading visible content.

@RoyEJohnson
Copy link
Contributor Author

I don't think I made any net changes to what's actually here, but the build test works now. All I did was restore some old versions of files to see what caused the test to fail. Then I got rid of those changes and squashed a few commits.

@TomWoodward
Copy link
Member

Somehow I feel like the screen reader is not going to do the right thing here with the target scrolling, but I'll approve what you have working so far

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.

4 participants