cds-snc / platform-forms-client

NextJS application that serves the public-facing website for Forms
https://forms-staging.cdssandbox.xyz/
MIT License
34 stars 13 forks source link

Preset "Date" and "Number" fields missing labels once inserted #3368

Open anikbrazeau opened 6 months ago

anikbrazeau commented 6 months ago

Description

Most preset form elements have a field label and hint text (as well as autocomplete attributes) prepopulated, except date and number.

Steps to reproduce

  1. Go to "Add a form element"
  2. Click on "Date"
  3. See it inserted in the form builder edit, check preview screen as well
  4. Go to "Add a form element"
  5. Click on "Number"
  6. See it inserted in the form builder edit, check preview screen as well

Details

Expected behaviour

Consistent experience where all presets have label?

EN: Date FR: Date

EN: Amount FR: Montant

Screenshots or videos

More for elements

preview

Abi-Nada commented 6 months ago

I picked up on this too, but interestingly that's the way it is in Staging/prod currently - so, not a bug.

@connorscarolyns can you confirm if this is by design?

connorscarolyns commented 6 months ago

@Abi-Nada This being one of our earlier elements, I don't believe we had any hard or fast rules in creating them. This was by design, because we don't really know the exact question they may be asking, it could be any kind of date or phone number, so the question part was left blank. Maybe it should have a preset question, although what we would put in the case of number field I'm not sure what would make sense.

anikbrazeau commented 6 months ago

Not a bug, but perhaps a backlog item.

Since we're now categorizing these as "presets" I think we should consider including a generic placeholder label/question as we do for other preset form elements ex: "Amount" and "Date". It's a weird experience to have preset hint text here but not a preset label. Also all the other presets we have currently have placeholder text pre-determined. Of course the option to modify/edit/customize the text here is available as it is for name/attestation/address etc. I think being consistent in our approach here would help to make things clearer.

Abi-Nada commented 6 months ago

Yeah that makes sense - I'll keep this in the backlog as an item to be pulled in + good to include this conversation to reference when we pick it up, but I'm going to remove it from our current scope of bug fixes for the App Router

connorscarolyns commented 6 months ago

Sounds good to me too