diff --git a/playwright/Customizations/Disk.spec.ts b/playwright/Customizations/Disk.spec.ts index 940033779a..65b2b6b162 100644 --- a/playwright/Customizations/Disk.spec.ts +++ b/playwright/Customizations/Disk.spec.ts @@ -109,7 +109,7 @@ test('Create a blueprint with Disk customization', async ({ .getByRole('row', { name: '/tmp/usb xfs 1 GiB', }) - .getByLabel('Partition name input') + .getByRole('textbox', { name: 'Partition name input' }) .fill('lv2'); await frame .getByRole('row', { diff --git a/src/Components/CreateImageWizard/ValidatedInput.tsx b/src/Components/CreateImageWizard/ValidatedInput.tsx index 13bb809afa..a667ab2ab3 100644 --- a/src/Components/CreateImageWizard/ValidatedInput.tsx +++ b/src/Components/CreateImageWizard/ValidatedInput.tsx @@ -6,7 +6,6 @@ import { HelperTextItem, TextArea, TextAreaProps, - TextInput, TextInputGroup, TextInputGroupMain, TextInputGroupMainProps, @@ -44,12 +43,9 @@ type ValidationInputProp = TextInputProps & warning?: string | undefined; forceErrorDisplay?: boolean; isDisabled?: boolean; + handleClear?: () => void; }; -type ErrorMessageProps = { - errorMessage: string; -}; - type ValidationResult = 'default' | 'success' | 'error'; export const ValidatedInputAndTextArea = ({ @@ -65,6 +61,7 @@ export const ValidatedInputAndTextArea = ({ isDisabled = false, warning = undefined, forceErrorDisplay = false, + handleClear, }: ValidationInputProp) => { const errorMessage = stepValidation.errors[fieldName] || ''; const hasError = errorMessage !== ''; @@ -109,16 +106,33 @@ export const ValidatedInputAndTextArea = ({ isDisabled={isDisabled} /> ) : ( - + > + + {value && ( + +