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

chore: Remove additional div from Modal #1635

Merged
merged 1 commit into from
Oct 11, 2023
Merged

Conversation

michaeldowseza
Copy link
Member

@michaeldowseza michaeldowseza commented Oct 10, 2023

Description

Additional div around the modal was initially used to associate the HTML node used by the Portal which would later be used to check from funnel step focus by checking if a focussed element is a descendant of this node. This information is useful to understand if a user is still on the same step when opening a modal from a form element in that given step, e.g. an s3 resource selector. However the additional div caused a layout shift.

We do not have a strong use case for embedded funnels inside a modal as they are primarily either a Form or Wizard and so we can ignore further interactions in this and change if new data is presented.

This change:

  • Reverts/refactors some code made in 1494
  • Adds a modal context so that funnel components can ignore some of the funnel functions when they detect they are in Modal

Related links, issue #, if available: AWSUI-22535

How has this been tested?

All existing unit tests passing which includes a test for if a funnel step state change happens when focus moves from an active step into a Modal inside a step.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (7774a42) 94.17% compared to head (d29eccd) 94.17%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1635   +/-   ##
=======================================
  Coverage   94.17%   94.17%           
=======================================
  Files         649      650    +1     
  Lines       17510    17512    +2     
  Branches     5752     5753    +1     
=======================================
+ Hits        16490    16492    +2     
  Misses        951      951           
  Partials       69       69           
Files Coverage Δ
src/container/internal.tsx 100.00% <100.00%> (ø)
...xpandable-section/expandable-section-container.tsx 100.00% <100.00%> (ø)
src/expandable-section/index.tsx 100.00% <100.00%> (ø)
src/expandable-section/internal.tsx 93.33% <ø> (ø)
src/internal/context/modal-context.ts 100.00% <100.00%> (ø)
src/modal/internal.tsx 100.00% <100.00%> (ø)
src/table/internal.tsx 99.28% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@michaeldowseza michaeldowseza marked this pull request as ready for review October 10, 2023 10:48
@michaeldowseza michaeldowseza requested a review from a team as a code owner October 10, 2023 10:48
@michaeldowseza michaeldowseza requested review from YueyingLu and removed request for a team October 10, 2023 10:48
YueyingLu
YueyingLu previously approved these changes Oct 11, 2023
- Reverts/refactors some code made in 1494
- Adds a modal context so that funnel components can react accordingly
- Update Funnel Version to 1.3
@michaeldowseza michaeldowseza merged commit f141be5 into main Oct 11, 2023
40 checks passed
@michaeldowseza michaeldowseza deleted the analytics/modal-fix branch October 11, 2023 14:03
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