Closed patcon closed 1 year ago
Alternative approach of simple wrapping useForm in a custom useForm (useFormCustom
?) that adds the default messages:
https://github.com/react-hook-form/react-hook-form/issues/458#issuecomment-1265907115
Closing in favour of #5416 since it has suggestions about the messages that should be presented.
ℹ️ Figma (root) | Sitemap This initial comment is collaborative and open to modification by all.
Related: https://github.com/GCTC-NTGC/gc-digital-talent/pull/3630 https://github.com/GCTC-NTGC/gc-digital-talent/issues/3588
Description
First off, deep apologies for not seeing the problem with adding a token to the default required message https://github.com/GCTC-NTGC/gc-digital-talent/pull/3536. I think the green CI tests made my brain turn off :/ Thanks to Eric for reverting 🙏
Anyhow, since the purpose was a11y, prob worth fixing. The intention of the var in the string was so that the default message would include reference to the field, and screen-readers would be giving more context when they interrupt with feedback.
Proposed steps:
Select
andMultiSelect
toSelectField
andMultiSelectField
(#3384 and #3128), but it might also be used in some other places like radio or checkbox fields, in which case it'll need to be accommodate manually (by passing the field name).Acceptance Criteria
errorMessages.required
still work