Render placeholder text in the Key Value form input (#3452)

This commit is contained in:
Hetu Nandu 2021-03-09 17:35:29 +05:30 committed by GitHub
parent bb9a9a307f
commit 6f4f2bb26c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -43,6 +43,7 @@ export interface ControlData {
dataType?: InputType;
isRequired?: boolean;
hidden?: HiddenType;
placeholderText?: string;
}
export interface ControlFunctions {

View File

@ -104,6 +104,9 @@ const KeyValueRow = (props: KeyValueArrayProps & WrappedFieldArrayProps) => {
name={`${field}.${keyName[1]}`}
showError
validate={keyFieldValidate}
placeholder={
(extraData && extraData[0].placeholderText) || ""
}
/>
</div>
{!props.actionConfig && (
@ -116,6 +119,9 @@ const KeyValueRow = (props: KeyValueArrayProps & WrappedFieldArrayProps) => {
<StyledTextField
name={`${field}.${valueName[1]}`}
type={valueDataType}
placeholder={
(extraData && extraData[1].placeholderText) || ""
}
/>
</div>
{index === props.fields.length - 1 ? (