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(internet-header): Trap focus is not working on overlays and missing in search overlay #2922

Merged
merged 13 commits into from
Jun 3, 2024

Conversation

imagoiq
Copy link
Contributor

@imagoiq imagoiq commented Apr 10, 2024

No description provided.

@imagoiq imagoiq self-assigned this Apr 10, 2024
@imagoiq imagoiq requested a review from a team as a code owner April 10, 2024 14:07
Copy link

changeset-bot bot commented Apr 10, 2024

🦋 Changeset detected

Latest commit: cdec39d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@swisspost/internet-header Patch
@swisspost/design-system-documentation Patch
@swisspost/design-system-nextjs-integration Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@swisspost-bot
Copy link
Contributor

swisspost-bot commented Apr 10, 2024

Preview environment ready: https://preview-2922--swisspost-design-system-next.netlify.app

@imagoiq imagoiq linked an issue Apr 10, 2024 that may be closed by this pull request
@imagoiq imagoiq requested review from gfellerph and removed request for alizedebray April 10, 2024 14:13
href={this.parcelSuggestion!.url}
data-suggestion-text={this.searchBox?.value}
onMouseEnter={e => this.handleMouseEnterSuggestion(e)}
<FocusTrap active={this.searchDropdownOpen}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not much changes:

  • Added <FocusTrap>
  • Added key attributes on 3 elements

@@ -27,7 +27,7 @@
"loader/"
],
"scripts": {
"dev": "stencil build --serve --port 9310 --watch --docs-readme",
"dev": "stencil build --serve --port 9310 --watch --docs-readme --dev",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This make it easier to use the browser debugger

@@ -70,6 +69,7 @@
"cypress-each": "1.14.0",
"cypress-storybook": "0.5.1",
"eslint-plugin-react": "7.34.1",
"focus-trap": "7.5.4",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

focus-trap is from the same creator as tabbable and uses it inside

@@ -171,7 +171,6 @@
position: relative;
background: white;
box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
visibility: hidden;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes the overlay not tabbable, I didn't see any differences without it.

…nd-add-it-to-search' into fix/internet-header-focus-trap-and-add-it-to-search
Copy link

sonarcloud bot commented Apr 24, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@imagoiq imagoiq assigned gfellerph and unassigned imagoiq Apr 25, 2024
Comment on lines -17 to 19
.find('div.overlay-container')
.should('have.class', 'loaded');
.find('[role=dialog].loaded', { timeout: 30000 })
.should('exist');

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A better test would be to check if the element is visible or not

@gfellerph gfellerph requested review from oliverschuerch and removed request for gfellerph May 2, 2024 14:09
@swisspost-bot
Copy link
Contributor

swisspost-bot commented Jun 3, 2024

Related Previews

Copy link

sonarcloud bot commented Jun 3, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@gfellerph gfellerph merged commit 9cd1f9a into main Jun 3, 2024
9 checks passed
@gfellerph gfellerph deleted the fix/internet-header-focus-trap-and-add-it-to-search branch June 3, 2024 11:18
gfellerph pushed a commit that referenced this pull request Jun 27, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @swisspost/design-system-icons@7.2.0

### Minor Changes

- Added icons number 2589, 2590 and 2591. (by
[@swisspost-bot](https://github.com/swisspost-bot) with
[#3109](#3109))

### Patch Changes

- Updated icon number 2074. (by
[@swisspost-bot](https://github.com/swisspost-bot) with
[#3172](#3172))

## @swisspost/design-system-intranet-header@7.2.0

### Minor Changes

- Added the possibility to hide the username in the profile dropdown.
(by [@juliandanis](https://github.com/juliandanis) with
[#3028](#3028))

### Patch Changes

- Enabled keyboard navigation for the user dropdown. (by
[@alizedebray](https://github.com/alizedebray) with
[#3119](#3119))
-   Updated dependencies:
    -   @swisspost/design-system-styles@7.2.0

## @swisspost/design-system-styles@7.2.0

### Minor Changes

- Added a small variant for the textarea with floating label (by
[@davidritter-dotcom](https://github.com/davidritter-dotcom) with
[#2857](#2857))

### Patch Changes

- Added @angular/core as an optional peer dependency to the styles
package to indicate the Angular versions that are compatible with the
current version of the styles. (by
[@gfellerph](https://github.com/gfellerph) with
[#3168](#3168))

- Fixed an issue with icon URL declarations when building styles with
esbuild. (by [@alizedebray](https://github.com/alizedebray) with
[#3123](#3123))

- Fixed the misaligned calendar icon in the datepicker input field. (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#3145](#3145))

- Implemented button wrapping for overflow in button groups. (by
[@alizedebray](https://github.com/alizedebray) with
[#3062](#3062))

## @swisspost/design-system-components@7.2.0

### Patch Changes

- Fixed a warning on the tooltip when the id was bound using Angular,
the ID check now runs at a later stage in the component lifecycle,
giving Angular enough time to set the attribute. (by
[@gfellerph](https://github.com/gfellerph) with
[#3155](#3155))
-   Updated dependencies:
    -   @swisspost/design-system-styles@7.2.0

## @swisspost/design-system-components-angular@7.2.0

### Patch Changes

- Redefined the dependency to the web components package as a dependency
instead of a peer dependency due to a [known bug in
changesets](changesets/changesets#1011) that
causes major version bumps across all linked workspace packages if one
of them is installed as a peer dependency. (by
[@gfellerph](https://github.com/gfellerph) with
[#3169](#3169))

- Updated `PostComponentsModule` to enable its use in lazy-loaded
modules. (by [@alizedebray](https://github.com/alizedebray) with
[#3118](#3118))

- Added `@swisspost/design-system-components` package as a peer
dependency as recommended by stenciljs. This way, installing
`@swisspost/design-system-components` package as a direct dependency
should not be necessary anymore in consumer projects. (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#3116](#3116))

-   Updated dependencies:
    -   @swisspost/design-system-components@7.2.0

## @swisspost/internet-header@1.13.11

### Patch Changes

- Fixed focus trap on overlay of the breadcrumb. Added a focus trap on
search overlay (by [@imagoiq](https://github.com/imagoiq) with
[#2922](#2922))
-   Updated dependencies:
    -   @swisspost/design-system-styles@7.2.0

## @swisspost/design-system-migrations@7.2.0



## @swisspost/design-system-documentation@5.2.0

### Minor Changes

- Added a small variant for the textarea with floating label (by
[@davidritter-dotcom](https://github.com/davidritter-dotcom) with
[#2857](#2857))

- Added documentation on how to use the Components for Angular with a
strict Content Security Policy (CSP). (by
[@alizedebray](https://github.com/alizedebray) with
[#3125](#3125))

### Patch Changes

- Fixed version switcher active state logic, to visualize the current
documentation version the user browses on. (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#3111](#3111))
-   Updated dependencies:
    -   @swisspost/design-system-icons@7.2.0
    -   @swisspost/design-system-styles@7.2.0
    -   @swisspost/design-system-components@7.2.0
    -   @swisspost/internet-header@1.13.11
    -   @swisspost/design-system-components-react@7.2.0

## @swisspost/design-system-components-angular-workspace@1.1.2

### Patch Changes

-   Updated dependencies:
    -   @swisspost/design-system-styles@7.2.0
    -   @swisspost/design-system-components@7.2.0

## @swisspost/design-system-components-react@7.2.0

### Patch Changes

-   Updated dependencies:
    -   @swisspost/design-system-components@7.2.0

## @swisspost/design-system-demo@7.3.2

### Patch Changes

-   Updated dependencies:
    -   @swisspost/design-system-styles@7.2.0
    -   @swisspost/design-system-intranet-header@7.2.0
    -   @swisspost/design-system-migrations@7.2.0

## @swisspost/design-system-intranet-header-workspace@3.0.14

### Patch Changes

-   Updated dependencies:
    -   @swisspost/design-system-styles@7.2.0

## @swisspost/design-system-intranet-header-showcase@1.0.2

### Patch Changes

-   Updated dependencies:
    -   @swisspost/design-system-intranet-header@7.2.0

## @swisspost/design-system-nextjs-integration@0.1.6

### Patch Changes

-   Updated dependencies:
    -   @swisspost/design-system-styles@7.2.0
    -   @swisspost/internet-header@1.13.11
    -   @swisspost/design-system-components-react@7.2.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

Header: Trap focus in mobile overlays
3 participants