fixes invalid text location

This commit is contained in:
Alex Corey
2020-10-07 09:11:44 -04:00
parent 4af4252604
commit ee28dff7cb

View File

@@ -227,10 +227,19 @@ function JobTemplateForm({
}} }}
/> />
</FieldWithPrompt> </FieldWithPrompt>
<> <FormGroup
fieldId="inventory-lookup"
validated={
!(inventoryMeta.touched || askInventoryOnLaunchField.value) ||
!inventoryMeta.error
? 'default'
: 'error'
}
helperTextInvalid={inventoryMeta.error}
isRequired={!askInventoryOnLaunchField.value}
>
<InventoryLookup <InventoryLookup
value={inventory} value={inventory}
fieldId="template-inventory"
promptId="template-ask-inventory-on-launch" promptId="template-ask-inventory-on-launch"
promptName="ask_inventory_on_launch" promptName="ask_inventory_on_launch"
isPromptableField isPromptableField
@@ -245,16 +254,7 @@ function JobTemplateForm({
touched={inventoryMeta.touched} touched={inventoryMeta.touched}
error={inventoryMeta.error} error={inventoryMeta.error}
/> />
{(inventoryMeta.touched || askInventoryOnLaunchField.value) && </FormGroup>
inventoryMeta.error && (
<div
className="pf-c-form__helper-text pf-m-error"
aria-live="polite"
>
{inventoryMeta.error}
</div>
)}
</>
<ProjectLookup <ProjectLookup
value={projectField.value} value={projectField.value}
onBlur={() => projectHelpers.setTouched()} onBlur={() => projectHelpers.setTouched()}