ExtJS 6 - 输入类型 'password' 的文本字段在 Chrome 开发工具中生成警告

ExtJS 6 - Textfield with inputType 'password' generating warning in Chrome dev tools

我的一个应用程序中有一个简单的 ExtJS 表单,我注意到 Chrome 给我一个警告,说表单中没有包含密码字段。这是确切的消息:

[DOM] Password field is not contained in a form:

这是重现问题的 fiddle:sencha fiddle

一切正常,但我不喜欢在控制台中看到警告,所以如果我做错了什么,我想补救。感谢任何可以提供帮助的人!

表单标签不会在经典的表单面板上生成。

但是。您可以使用 autoEl 配置来实现它:)

Ext.application({
name: 'Fiddle',

launch: function () {
    Ext.create('Ext.panel.Panel', {
        renderTo: 'blah',
        title: 'panel',
        layout: 'fit',
        items: [
            {
                xtype: 'form',
                autoEl:'form', //<----- <form> tags will be created
                defaultType: 'textfield',
                items: [
                    {
                        fieldLabel: 'user'
                    },
                    {
                        fieldLabel: 'pass',
                        inputType: 'password'
                    }
                    ]
            }]
    });
}
});