Validation errors not showing up for type day

未关闭
#572 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
react, typescript
领域
frontend

调研方向

从链接的 CodeSandbox 复现开始,在输入和提交时复现缺失的 day-component 错误。跟踪 day-component 的验证错误渲染和类应用,并将其与 textfield 的行为进行比较。在无需 workaround 的情况下,自定义错误在两个流程中都可见即视为完成。

由索引模型根据 Issue 内容生成。

描述

help wanted

I have a form with two components, one of type day, with day, month and year required, and one of type textfield, required. Both have a custom error message.

Both while typing and on submission, errors are not shown for the day component. I tried calling the submit function and I noticed the error is actually thrown. It seems like the library is not adding the correct class to the element in order for the error to be shown.

To Reproduce
Steps to reproduce the behavior:

  1. Go to repro: https://codesandbox.io/p/sandbox/modest-worker-mtztn2
  2. Click on "verify"
  3. See that error on day is not shown
  4. Click on "vertify with workaround"
  5. See that error on day is now shown thanks to the ugly workaround I implemented

Expected behavior
Errors on day component should be shown both while typing and on submit

Screenshots
Without workaround:
image
With workaround:
image

Desktop (please complete the following information):

  • OS: Tested on Windows 10 and macOS 14.5
  • Browser chromium based
  • Version 127.0.6533.73

Additional context
The version of the libs in the repro are the exact ones I use in my project

主要语言
TypeScript
星标
371
派生
309
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

formio/react 的其他 Issue

查看 formio/react 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。