-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix(internet-header): Trap focus is not working on overlays and missing in search overlay #2922
Conversation
…ng in search overlay
🦋 Changeset detectedLatest commit: cdec39d The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Preview environment ready: https://preview-2922--swisspost-design-system-next.netlify.app |
…ionalcomponent to be able to target element without hack
…ionalcomponent to be able to target element without hack
packages/internet-header/src/components/focus-trap.component.tsx
Outdated
Show resolved
Hide resolved
packages/internet-header/src/components/focus-trap.component.tsx
Outdated
Show resolved
Hide resolved
href={this.parcelSuggestion!.url} | ||
data-suggestion-text={this.searchBox?.value} | ||
onMouseEnter={e => this.handleMouseEnterSuggestion(e)} | ||
<FocusTrap active={this.searchDropdownOpen}> |
There was a problem hiding this comment.
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
packages/internet-header/src/components/shared/focus-trap.component.tsx
Outdated
Show resolved
Hide resolved
@@ -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", |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
Quality Gate passedIssues Measures |
.find('div.overlay-container') | ||
.should('have.class', 'loaded'); | ||
.find('[role=dialog].loaded', { timeout: 30000 }) | ||
.should('exist'); | ||
|
There was a problem hiding this comment.
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
Related Previews |
Quality Gate passedIssues Measures |
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/[email protected] ### 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/[email protected] ### 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/[email protected] ## @swisspost/[email protected] ### 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/[email protected] ### 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/[email protected] ## @swisspost/[email protected] ### 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/[email protected] ## @swisspost/[email protected] ### 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/[email protected] ## @swisspost/[email protected] ## @swisspost/[email protected] ### 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/[email protected] - @swisspost/[email protected] - @swisspost/[email protected] - @swisspost/[email protected] - @swisspost/[email protected] ## @swisspost/[email protected] ### Patch Changes - Updated dependencies: - @swisspost/[email protected] - @swisspost/[email protected] ## @swisspost/[email protected] ### Patch Changes - Updated dependencies: - @swisspost/[email protected] ## @swisspost/[email protected] ### Patch Changes - Updated dependencies: - @swisspost/[email protected] - @swisspost/[email protected] - @swisspost/[email protected] ## @swisspost/[email protected] ### Patch Changes - Updated dependencies: - @swisspost/[email protected] ## @swisspost/[email protected] ### Patch Changes - Updated dependencies: - @swisspost/[email protected] ## @swisspost/[email protected] ### Patch Changes - Updated dependencies: - @swisspost/[email protected] - @swisspost/[email protected] - @swisspost/[email protected] Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
No description provided.