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

feat: focustrap: export focus trap and add new hook props #743

Conversation

dkilgore-eightfold
Copy link
Contributor

SUMMARY:

  • Adds FocusTrap and useFocusTrap to exports
  • Adds three new FocusTrap props to extend support for complex multi-dimensional async content implementations:
  • firstFocusableSelector
  • lastFocusableSelector
  • skipFocusableSelectorsFromIndex
  • Adds new renderContentAlways prop with a default value of true for backwards compatibility to Dialog, Modal and Panel as well as the above FocusTrap props.
  • Adds unit tests
  • Updates stories
panelFocusTrapFixup.mp4

JIRA TASK (Eightfold Employees Only):

ENG-69361

CHANGE TYPE:

  • Bugfix Pull Request
  • Feature Pull Request

TEST COVERAGE:

  • Tests for this change already exist
  • I have added unittests for this change

TEST PLAN:

Pull the PR branch and run yarn and yarn storybook. Verify the Panel, Dialog and Modal stories behave as expected.

Copy link

codesandbox-ci bot commented Oct 31, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 6ee693e:

Sandbox Source
React Configuration
Vanilla Configuration

Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Files Coverage Δ
src/components/Dialog/BaseDialog/BaseDialog.tsx 97.91% <100.00%> (+0.13%) ⬆️
src/components/Panel/Panel.tsx 82.88% <100.00%> (+1.40%) ⬆️
src/shared/FocusTrap/FocusTrap.tsx 80.00% <100.00%> (ø)
src/shared/FocusTrap/hooks/useFocusTrap.ts 80.76% <60.00%> (-3.68%) ⬇️

... and 1 file with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@dkilgore-eightfold dkilgore-eightfold merged commit 43f34ef into EightfoldAI:main Oct 31, 2023
3 of 5 checks passed
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.

2 participants