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 TOC when TOC is opened #2102

Merged
merged 6 commits into from
Feb 13, 2024
Merged

Conversation

RoyEJohnson
Copy link
Contributor

@RoyEJohnson RoyEJohnson commented Jan 5, 2024

For: https://github.com/openstax/unified/issues/2711
Also added an aria-label to HighlightsHelpInfo close button

@RoyEJohnson RoyEJohnson requested a review from a team as a code owner January 5, 2024 22:38
@RoyEJohnson RoyEJohnson requested a review from jivey January 5, 2024 22:38
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 5, 2024 22:38 Inactive
@RoyEJohnson RoyEJohnson force-pushed the focus-on-toc-when-toc-opens branch from d363166 to 1838b76 Compare January 5, 2024 22:38
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 5, 2024 22:39 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 8, 2024 14:33 Inactive
Copy link
Member

@jivey jivey left a comment

Choose a reason for hiding this comment

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

Looks good, I think the spec failure is flaky, I reran it and hopefully it passes 🤞

src/app/content/components/TableOfContents/index.tsx Outdated Show resolved Hide resolved
@RoyEJohnson RoyEJohnson force-pushed the focus-on-toc-when-toc-opens branch from 9807e98 to ba4c792 Compare January 8, 2024 16:17
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 8, 2024 16:17 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 8, 2024 22:06 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 9, 2024 19:50 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 9, 2024 20:21 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 9, 2024 21:25 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 10, 2024 15:25 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 11, 2024 16:29 Inactive
@RoyEJohnson RoyEJohnson force-pushed the focus-on-toc-when-toc-opens branch from a5eab91 to 41d80f7 Compare January 11, 2024 19:48
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 11, 2024 19:48 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 11, 2024 20:19 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 11, 2024 21:01 Inactive
@RoyEJohnson RoyEJohnson force-pushed the focus-on-toc-when-toc-opens branch from a48544e to 2c7c787 Compare January 11, 2024 21:13
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 11, 2024 21:13 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 12, 2024 19:17 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 12, 2024 21:13 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 12, 2024 21:14 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 12, 2024 21:15 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 12, 2024 21:15 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 12, 2024 21:15 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 12, 2024 21:16 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-xzvaeh January 12, 2024 21:16 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-nwxpz2 February 9, 2024 22:53 Inactive
@Malar-Natarajan
Copy link
Contributor

@RoyEJohnson I merged a related card and this now has conflicts to be resolved

@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-nwxpz2 February 13, 2024 15:08 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.

i pushed a commit fixing the test for transitionend and coverage, looks good otherwise

});
reactDomAct(() => {
sb?.dispatchEvent(new Event('transitionend'));
});
Copy link
Member

Choose a reason for hiding this comment

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

the trick was that the event listener isn't added until the thing re-renders with the open prop, so you need to have the event dispatch in a separate act call after you update the open state

@TomWoodward TomWoodward had a problem deploying to rex-web-focus-on-toc-wh-nwxpz2 February 13, 2024 15:40 Failure
@RoyEJohnson RoyEJohnson force-pushed the focus-on-toc-when-toc-opens branch from 53d42e9 to 70ae22b Compare February 13, 2024 15:59
@TomWoodward TomWoodward temporarily deployed to rex-web-focus-on-toc-wh-nwxpz2 February 13, 2024 16:00 Inactive
@Malar-Natarajan Malar-Natarajan merged commit c2628de into main Feb 13, 2024
9 of 11 checks passed
@Malar-Natarajan Malar-Natarajan deleted the focus-on-toc-when-toc-opens branch February 13, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants