Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

做表单校验时,getFieldProps 第一个参数如果填写 'nodeName',就会报错。 #2950

Closed
zhangbody opened this issue Sep 6, 2016 · 2 comments
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@zhangbody
Copy link

本地环境

  • antd 版本: 1.11.0
  • 操作系统及其版本:Mac OS 10.11.6
  • 浏览器及其版本: Chrome 53.0.2785.89 (64-bit)

你做了什么?

使用表单验证时,getFieldProps 第一个参数填写 'nodeName'。

            const props = getFieldProps('nodeName', {
                rules: [
                    { required: true}
                ]
            });

你期待的结果是:

能正常校验。

实际上的结果:

console 中不断报出错误。

            Uncaught TypeError: elem.nodeName.toLowerCase is not a function

只要 ID 不用 'nodeName',就没有问题。

@ddcat1115 ddcat1115 added the 🐛 Bug Ant Design Team had proved that this is a bug. label Sep 7, 2016
@benjycui benjycui self-assigned this Sep 7, 2016
@benjycui
Copy link
Contributor

benjycui commented Sep 9, 2016

React 的问题 facebook/react#6284

@shaozj
Copy link

shaozj commented Jul 5, 2017

好像是浏览器 bug:

var form = document.createElement('form');
var input = document.createElement('input');
input.setAttribute('id', 'nodeName');
form.appendChild(input);
console.log(form);

在 chrome 中输出:
TypeError: (var).nodeName.toLowerCase is not a function
at :5:9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants