Polymer 使用Enter'提交铁制表格;当焦点在纸上输入时不工作
考虑以下观点:Polymer 使用Enter'提交铁制表格;当焦点在纸上输入时不工作,polymer,Polymer,考虑以下观点: <link rel="import" href="../bower_components/polymer/polymer-element.html"> <link rel="import" href="shared-styles.html"> <link rel="import" href="../bower_components/paper-input/paper-input.html"> <link rel="import" href
<link rel="import" href="../bower_components/polymer/polymer-element.html">
<link rel="import" href="shared-styles.html">
<link rel="import" href="../bower_components/paper-input/paper-input.html">
<link rel="import" href="../bower_components/paper-button/paper-button.html">
<link rel="import" href="../bower_components/iron-form/iron-form.html">
<dom-module id="my-view1">
<template>
<style include="shared-styles">
:host {
display: block;
padding: 10px;
}
</style>
<div class="card">
<div class="circle">1</div>
<h1>View One</h1>
<iron-form id="loginForm">
<form action="/" method="POST">
<label>From here it works:</label>
<input type="text" id="name" name="user_name">
<paper-input id="uid" label="Username" type="text" required auto-validate></paper-input>
<paper-input id="pwd" label="Password" type="password" required auto-validate></paper-input>
<button type="submit" class="no-style">Submit</button>
</form>
</iron-form>
</div>
</template>
<script>
class MyView1 extends Polymer.Element {
static get is() { return 'my-view1'; }
}
window.customElements.define(MyView1.is, MyView1);
</script>
</dom-module>
:主持人{
显示:块;
填充:10px;
}
1.
视图一
从这里起作用:
提交
类MyView1扩展了Polymer.Element{
静态get是(){return'my-view1';}
}
window.customElements.define(MyView1.is,MyView1);
当焦点位于
时,点击回车键将提交表单。当焦点位于
时,它将不显示
这在聚合物1中使用效果良好
有什么变化吗
谢谢。同时,在修复此特定于浏览器的错误时,您可以添加onkeyup事件,并调用一个方法,在用户点击enter时发送表单
<paper-input on-keyup="postForm" label="username" value="{{username::input}}">
同时,在修复此特定于浏览器的错误时,您可以添加一个onkeyup事件,并调用一个在用户点击enter时发送表单的方法
<paper-input on-keyup="postForm" label="username" value="{{username::input}}">
这似乎有关系这似乎有关系