DouglasNeuroInformatics / libui

Generic UI components for DNP projects, built using React and TailwindCSS
https://douglasneuroinformatics.github.io/libui/
Apache License 2.0
2 stars 2 forks source link

Form elements need default values that are visible #21

Open gdevenyi opened 6 months ago

gdevenyi commented 6 months ago

Default values are currently settable in the zod object, but observe this degenerate case:

    noWorkStudyUnrelated: {
      description: {
        en: 'a',
        fr: 'b'
      },
      label: {
        en: 'I have not worked / studied at all during the past week for reasons unrealted to the disorder.',
        fr: "Je n'ai pas travaillé ou étudié du tout pour des raisons non liées au problème."
      },
      kind: 'boolean',
      variant: 'radio'
    },

This is rendered on the page as an empty (unselected) radio box boolean.

    noWorkStudyUnrelated: z.boolean().default(true),

This radio box actually has default value true, and if I press submit the form will be accepted with that value.