Skip to content

Commit b6a5d59

Browse files
committed
task: [InputEntry] Propagate fallbackValue to underlying DisplayField
1 parent 70bbc40 commit b6a5d59

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/components/InputEntry.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Element } from 'react-scroll';
66
import InputErrorMessage from 'components/InputErrorMessage';
77
import LabelOptional from 'components/LabelOptional';
88
import { Heading, TextInput } from 'design-system-react';
9+
import type { DisplayFieldProperties } from 'pages/Filing/ViewInstitutionProfile/DisplayField';
910
import { DisplayField } from 'pages/Filing/ViewInstitutionProfile/DisplayField';
1011

1112
interface InputEntryProperties
@@ -22,7 +23,10 @@ interface InputEntryProperties
2223
helperText?: string;
2324
}
2425

25-
const InputEntry = forwardRef<HTMLInputElement, InputEntryProperties>(
26+
const InputEntry = forwardRef<
27+
HTMLInputElement,
28+
DisplayFieldProperties & InputEntryProperties
29+
>(
2630
(
2731
{
2832
className = '',
@@ -37,6 +41,7 @@ const InputEntry = forwardRef<HTMLInputElement, InputEntryProperties>(
3741
isOptional = false,
3842
type = 'text',
3943
helperText,
44+
fallbackValue,
4045
...properties
4146
},
4247
reference,
@@ -78,7 +83,13 @@ const InputEntry = forwardRef<HTMLInputElement, InputEntryProperties>(
7883
/>
7984
</>
8085
)}
81-
{hideInput ? <DisplayField label={label} value={children} /> : null}
86+
{hideInput ? (
87+
<DisplayField
88+
label={label}
89+
value={children}
90+
fallbackValue={fallbackValue}
91+
/>
92+
) : null}
8293
{handleError ? (
8394
<div>
8495
<InputErrorMessage>{errorMessage}</InputErrorMessage>

0 commit comments

Comments
 (0)