Skip to content

Commit

Permalink
Merge pull request #739 from rottencandy/fix/runtime-disable-479
Browse files Browse the repository at this point in the history
Touch runtime detection fields if runtime selection succeedes
  • Loading branch information
openshift-merge-robot committed Aug 3, 2023
2 parents 48e1381 + 88f8295 commit 04c6911
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/ImportForm/ReviewSection/RuntimeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,11 @@ export const RuntimeSelector: React.FC<RuntimeSelectorProps> = ({ detectedCompon
setFieldError(`${fieldPrefix}.runtime`, detectionError);
} else if (detectionLoaded && detectedComponents) {
setDetecting(false);
setFieldValue('isDetected', true);
setFieldValue('detectionFailed', false);
// To avoid formik validating on old values due to a formik bug - https://github.com/jaredpalmer/formik/issues/2083
setTimeout(() => setFieldValue('isDetected', true));
setTimeout(() => setFieldValue('detectionFailed', false));
setTimeout(() => setFieldTouched('isDetected', true));
setTimeout(() => setFieldTouched('detectionFailed', true));
const componentValues = transformComponentValues(
detectedComponents,
originalComponentRef.current,
Expand All @@ -210,6 +212,7 @@ export const RuntimeSelector: React.FC<RuntimeSelectorProps> = ({ detectedCompon
detectionLoaded,
fieldPrefix,
setFieldError,
setFieldTouched,
setFieldValue,
sourceUrl,
defaultResourceLimits,
Expand Down

0 comments on commit 04c6911

Please sign in to comment.