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

fix(CreateTearsheet): add focus trap back to CreateTearsheet/CreateTearsheetStep #5329

Conversation

matthewgallo
Copy link
Member

Closes #5309

Adds back the focus trap behavior in CreateTearsheet. This was accomplished by changing the tab-index of focusable elements based on the current step. The new useFocus hook will filter out any focusable elements (inputs, buttons, selects, textareas) if they have a tab-index of -1.

I also noticed a bug in CreateTearsheetStep while working on this where the ref we forward to the Grid component does not work because the Grid does not forward refs, so I wrapped the component in a div so that the ref can be applied as expected.

What did you change?

cspell.json
packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetStep.tsx
e2e/components/WebTerminal/WebTerminal-test.avt.e2e.js --> Looks like just a linting change was applied in precommit

How did you test and verify your work?

@matthewgallo matthewgallo added component: CreateTearsheet Create flows type: a11y ♿ Issues not following accessibility standards labels May 23, 2024
@matthewgallo matthewgallo requested a review from a team as a code owner May 23, 2024 18:02
@matthewgallo matthewgallo requested review from IgnacioBecerra and amal-k-joy and removed request for a team May 23, 2024 18:02
Copy link

netlify bot commented May 23, 2024

Deploy Preview for carbon-for-ibm-products ready!

Name Link
🔨 Latest commit 37d28f4
🔍 Latest deploy log https://app.netlify.com/sites/carbon-for-ibm-products/deploys/664f84a0e117ce00088e4a1e
😎 Deploy Preview https://deploy-preview-5329--carbon-for-ibm-products.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@amal-k-joy amal-k-joy 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 👍

Copy link
Contributor

@IgnacioBecerra IgnacioBecerra left a comment

Choose a reason for hiding this comment

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

lgtm!

@matthewgallo matthewgallo added this pull request to the merge queue Jun 4, 2024
Merged via the queue into carbon-design-system:main with commit 3205383 Jun 4, 2024
19 checks passed
@matthewgallo matthewgallo deleted the 5309-create-tearsheet-step-focus branch June 4, 2024 13:33
makafsal pushed a commit to makafsal/ibm-products that referenced this pull request Jun 5, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jun 6, 2024
* refactor(DataGrid): implement types for DataGrid component

* refactor(DataGridContent): implement types for DataGridContent file

* refactor(filterSummary): implement types

* refactor(datagridContent): implement types

* refactor(datagridHead): implement types

* refactor(datagridBody): implement types

* refactor(datagridEmptyBody): implement types

* fix(datagridEmptyBody): empty state props

* refactor(DatagridVirtualBody): implement types

* refactor(datagridRefBody): implement types

* refactor(DatagridSimpleBody): implement types

* refactor(DatagridExpandedRow): implement types

* refactor(DatagridHeaderRow): implement types

* refactor(DatagridSlug): implement types

* refactor(DatagridRow): implement types

* refactor(DatagridSelectAll): implement types

* refactor(DatagridSelectAllWithToggle): implement types

* refactor(DatagridToolbar): implement types

* refactor(DraggableEleemt): implement types

* refactor(dataGrid): import carbon component props

* refactor(DataGrid): reuse react-table types

* refactor(DatagridHeaderRow): assign key value separately

* refactor: change types according to react-table types

* fix(datagrid): remove emptyState props

* refactor: revert empty state props

* refactor(datagrid): move index file to .ts

* refactor: update type for state in all files

* refactor: change row typw

* chore: test issue

* chore: revert test code

* chore: remove condition

* chore: remove condition

* chore: revert condition

* chore: state destructure

* chore: test deployment issue 1

* chore: test deployment issue 1

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* refactor: test deploy error

* fix(DataGrid): resolve error in deployment

* fix(DataGrid): resolve error on deployed version

* chore(Datagrid): resolve PR comments

* chore: dummy commit to rerun jobs

* chore: remove unwanted line

* refactor: change react-table types version

* refactor: change react-table types version

* chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

* chore: dummy commit to rerun jobs

chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

* chore: dummy commit to rerun jobs

chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

chore: dummy commit to rerun jobs

chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

* chore(release): publish [skip ci]

 - @carbon/ibm-cloud-cognitive-core@2.18.3
 - @carbon/ibm-products@2.41.0
 - @carbon/ibm-products-styles@2.38.0

* chore(Datagrid): resolve PR comments

* fix(CreateTearsheet): add focus trap behavior (#5329)

* test(ExpressiveCard): add @AVT test for default state (#5393)

* test(Toolbar): add default state AVT test (#5395)

* fix(Coachmark): ssr issues with `instanceOf(HTMLElement)` (#5391)

* fix(Coachmark): ssr issues with htmlelement

* chore: remove unnecessary export

* Add .whitesource configuration file (#5323)

Co-authored-by: ibm-mend-app[bot] <142626574+ibm-mend-app[bot]@users.noreply.github.com>
Co-authored-by: Jeff Chew <jeff.chew@gmail.com>

* refactor(TagOverflowModal): add Typescript types to TagOverflowModal (#5311)

* fix(Datagrid): add disable cell support (#5385)

* test(ProductiveCard): add default state AVT test (#5394)

* feat(FeatureFlags): add new mechanism for feature flagging using `@carbon/feature-flags` (#5204)

* feat(FeatureFlags): add feature flag support using carbon package

* chore: import feature flags and update lock

* chore: remove console log

* feat: use new feature flag system and add mdx docs

* chore: add annotation component to example story

* fix: remove utility hook from portal target hook

* chore: rename feature-flags file

* chore: remove console log

* chore: add feature flag component to editable cell stories

* fix: import feature flags file

* fix: import feature flags in jest setup

* fix: update tests

* chore: remove old generated feature flags

* chore: import feature flags

* fix: add feature flags file as side effect

* chore: add test file

* chore(feature-flags): rename to match carbon naming patterns

chore: dummy commit to rerun jobs

chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

chore: dummy commit to rerun jobs

chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

chore: dummy commit to rerun jobs

chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

chore: dummy commit to rerun jobs

chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

chore: remove unwanted line

refactor: change react-table types version

refactor: change react-table types version

* chore: resolve merge conflict

* refactor: resolve minor issues

* test: resolve test issue

---------

Co-authored-by: github-merge-queue <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Gallo <mdgallo@us.ibm.com>
Co-authored-by: andrew <emyarod@users.noreply.github.com>
Co-authored-by: Ignacio Becerra <i1becerr@ucsd.edu>
Co-authored-by: ibm-mend-app[bot] <142626574+ibm-mend-app[bot]@users.noreply.github.com>
Co-authored-by: Jeff Chew <jeff.chew@gmail.com>
Co-authored-by: Anamika T S <47971732+anamikaanu96@users.noreply.github.com>
Co-authored-by: Austin <aj_viens_deruisseau@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: CreateTearsheet Create flows type: a11y ♿ Issues not following accessibility standards
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[a11y]: CreateTearsheetStep does not auto focus on the Tearsheet after first step
3 participants