DataTable nests `<form>` inside `<form>`
未关闭
还没有人认领这个 Issue。
bug
- 主要语言
- Ruby
- 星标
- 1k
- 派生
- 67
- 平均合并
- 3 天 12 小时
- 30 天内合并 PR
- 14
描述
- Where:
DataTableFormwraps the table;DataTableSearchand
DataTablePerPageSelecteach render their own<form>inside it.
Snapshotdata_table/full_frameholds three<formelements. - Effect: nested forms are invalid HTML. A browser ignores the inner
<form>start tags when a form is in scope, so the search input and the
per-page select become children of the outer bulk form, and
this.form.requestSubmit()indata_table_search_controller.jssubmits
the wrong form. - Fix: render the search and per-page forms outside the bulk form, or
make their controls reference it with theform=attribute; re-record (on the 2.0 line)
data_table/*. - 2.0 note: Herb's
NestingValidatorwill likely reject this at compile
time, which makes it a template adjustment in the DataTable migration.
Fixing it on 1.6 first keeps the migration a pure port.
Surfaced by the golden HTML suite (PR #536), which pins what 1.6 renders today — this defect included. Per maintainer decision (2026-09-19) main stays as is: this is addressed on the 2.0 line, and the golden snapshot that pins it is re-recorded there with the diff reviewed.
Source: design/v2/follow-up-issues.md.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先从 DataTableForm、DataTableSearch、DataTablePerPageSelect 和 data_table_search_controller.js 开始,然后检查 data_table/full_frame 快照和其他 data_table 快照。确认渲染后的表单结构,以及 requestSubmit() 如何选择其目标。完成的标准是 2.0 模板避免嵌套表单,并使用修正后的输出重新记录和审查 data_table/* 快照。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, ruby
- 领域
- frontend, testing
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 描述清楚
- 新手友好度
- 68/100