Skip to content

Commit

Permalink
fix(NotificationsPanel): remove focus trap (#6829)
Browse files Browse the repository at this point in the history
* fix(NotificationsPanel): remove focus trap

* fix: added escape key functionality

* fix: removed styling

* fix: comments

* fix: restore trigger button ref

* fix: remove commented code in story

* fix: missing closing animation

* fix: e2e test

Removed tests that confirmed focus trapping.

* fix: remove commented code
  • Loading branch information
paul-balchin-ibm authored Feb 7, 2025
1 parent c85b197 commit ccd0926
Show file tree
Hide file tree
Showing 6 changed files with 277 additions and 230 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,6 @@ test.describe('NotificationsPanel @avt', () => {
);
await expect(notificationPanel).toBeVisible();

const firstElement = page.locator(
`button.${pkg.prefix}--notifications-panel__dismiss-button`
);
await firstElement.focus();
await expect(firstElement).toBeFocused();

const lastElement = page.locator(
`button.${pkg.prefix}--notifications-panel__settings-button`
);
await page.keyboard.press('Shift+Tab');
await expect(lastElement).toBeFocused();

await page.keyboard.press('Tab');
await expect(firstElement).toBeFocused();

for (let i = 0; i < 10; i++) {
await page.keyboard.press('Tab');
await expect(notificationPanel).toContainText(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ $block-class: #{c4p-settings.$pkg-prefix}--notifications-panel;
.#{$block-class}__notification-read-less-button {
@include type.type-style('label-01');

display: flex;
align-items: center;
padding: 0;

min-inline-size: 5.5rem;

.#{c4p-settings.$carbon-prefix}--btn__icon {
Expand Down Expand Up @@ -274,6 +275,10 @@ $block-class: #{c4p-settings.$pkg-prefix}--notifications-panel;
inset-block-end: 0;
min-block-size: 2.5rem;
.#{$block-class}__view-all-button {
display: flex;
width: 100%;
max-width: calc(100% - 2.5rem);
align-items: center;
block-size: 2.5rem;
border-inline-end: 1px solid $layer-02;
color: $text-primary;
Expand Down
Loading

0 comments on commit ccd0926

Please sign in to comment.