Skip to content

Commit

Permalink
chore: fixed on ff too
Browse files Browse the repository at this point in the history
  • Loading branch information
meza committed Apr 6, 2023
1 parent ecb4fc8 commit 5f9603a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions playwright/e2e/cookieconsent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ test('the cookie consent can be accepted via ESC', async ({ browser }) => {
const page = await context.newPage();
await page.emulateMedia({ reducedMotion: 'reduce' });
await page.goto('/');
await page.waitForLoadState('networkidle');

const dialog = await page.getByRole('dialog');
await expect(dialog).toBeInViewport();
Expand Down
3 changes: 2 additions & 1 deletion src/components/CookieConsent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export const CookieConsentBanner = () => {

const acceptOnKeyDown = (event: KeyboardEvent) => {
if (event.key === 'Escape' && acceptFormRef.current) {
acceptFormRef.current.submit();
event.preventDefault();
acceptFormRef.current.requestSubmit();
}
};

Expand Down

0 comments on commit 5f9603a

Please sign in to comment.