Ability to write placeholder in routing forms (#7054)
parent
d59cda3286
commit
74fe20802d
|
@ -50,6 +50,7 @@ export default function FormInputFields(props: Props) {
|
|||
<div className="flex rounded-sm">
|
||||
<Component
|
||||
value={response[field.id]?.value}
|
||||
placeholder={field.placeholder ?? ""}
|
||||
// required property isn't accepted by query-builder types
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
/* @ts-ignore */
|
||||
|
|
|
@ -139,6 +139,15 @@ function Field({
|
|||
onChange={(e) => setUserChangedIdentifier(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<div className="mb-6 w-full">
|
||||
<TextField
|
||||
disabled={!!router}
|
||||
label="Placeholder"
|
||||
placeholder="This will be the placeholder"
|
||||
defaultValue={routerField?.placeholder}
|
||||
{...hookForm.register(`${hookFieldNamespace}.placeholder`)}
|
||||
/>
|
||||
</div>
|
||||
<div className="mb-6 w-full ">
|
||||
<Controller
|
||||
name={`${hookFieldNamespace}.type`}
|
||||
|
|
|
@ -4,6 +4,7 @@ export const zodNonRouterField = z.object({
|
|||
id: z.string(),
|
||||
label: z.string(),
|
||||
identifier: z.string().optional(),
|
||||
placeholder: z.string().optional(),
|
||||
type: z.string(),
|
||||
selectText: z.string().optional(),
|
||||
required: z.boolean().optional(),
|
||||
|
|
Loading…
Reference in New Issue