diff --git a/app/components/form/SideModalForm.tsx b/app/components/form/SideModalForm.tsx index d1e6075fe..4aadd4115 100644 --- a/app/components/form/SideModalForm.tsx +++ b/app/components/form/SideModalForm.tsx @@ -5,6 +5,7 @@ * * Copyright Oxide Computer Company */ + import { useEffect, useId, useState, type ReactNode } from 'react' import type { FieldValues, UseFormReturn } from 'react-hook-form' import { NavigationType, useNavigationType } from 'react-router-dom' @@ -127,11 +128,11 @@ export function SideModalForm({ {children} - - - {onSubmit && ( + {onSubmit && ( + + - )} - + + )} {showNavGuard && ( )} {children} + + {/* Close button is here at the end so we aren't automatically focusing on it when the side modal is opened. Positioned in the safe area at the top */} + + + @@ -161,15 +169,5 @@ SideModal.Footer = ({ children, error }: { children: ReactNode; error?: boolean )} {children} - {/* - Close button is here at the end so we aren't automatically focusing on it - when the side modal is opened. Positioned in the safe area at the top - */} - - - ) diff --git a/test/e2e/silos.e2e.ts b/test/e2e/silos.e2e.ts index 87a33a84d..e0b8dd1dc 100644 --- a/test/e2e/silos.e2e.ts +++ b/test/e2e/silos.e2e.ts @@ -200,7 +200,7 @@ test('Identity providers', async ({ page }) => { 'groups' ) - await page.getByRole('button', { name: 'Cancel' }).click() + await page.getByRole('button', { name: 'Close' }).click() await expect(dialog).toBeHidden() @@ -320,7 +320,7 @@ test('Silo IP pools link pool', async ({ page }) => { await expect(modal).toBeVisible() // close modal works - await page.getByRole('button', { name: 'Cancel' }).click() + await page.getByRole('button', { name: 'Close' }).click() await expect(modal).toBeHidden() // reopen