0
我的表格使用paper-input
字段在按下chrome中的回車鍵時不會提交。但是,在所有其他瀏覽器中按Enter鍵時都會提交。下面是相關代碼:爲什麼我的表單在按下Enter鍵入時未提交?
<form [ngFormModel]="loginForm">
<paper-input type="text"
ngControl="username"
label="Username"
auto-validate
pattern="{{usernameValidation.get()}}"
maxlength="20"
error-message="Alphanumeric and underscore characters only. [1-20]"
ngDefaultControl>
<iron-icon suffix icon="account-circle"></iron-icon>
</paper-input>
<paper-input type="password"
ngControl="password"
label="Password"
auto-validate
pattern="{{passwordValidation.get()}}"
maxlength="60"
error-message="Long passwords only. [8-60]"
ngDefaultControl>
<iron-icon suffix icon="fingerprint"></iron-icon>
</paper-input>
<paper-input type="submit"
value="Log In"
(click)="submit()"
[disabled]="!loginForm.valid || loading"
ngDefaultControl>
</paper-input>
</form>
我曾嘗試使用ngSubmit
移動submit()
函數調用表單元素,並嘗試添加一個隱藏的,標準提交輸入表單欺騙鍍鉻進提交,但有沒有運氣。我也嘗試使用標準input
元素以及button
。任何輸入將在這裏讚賞。謝謝!
如果有人想解釋倒票,我會很樂意修改我的問題。
我認爲這是因爲
感謝您的建議@GordonFreeman,但我認爲這個錯誤是關係到聚合物,因爲沒有其他元素類型的工作。 –