【发布时间】:2018-01-08 13:23:22
【问题描述】:
在将 Firefox(版本 54 和 55)用于 Android 或桌面并将 dom.forms.datetime 标志设置为 true 时。它打开一个日历模式,供用户选择日期。但是当用户选择日期时,验证不会更新并且提交按钮继续禁用。
my.component.html:
<input id="deadline"
type="date"
class="form-control"
name="deadline"
placeholder="yyyy-mm-dd"
formControlName="deadline">
<button type="submit" class="btn btn-primary" [disabled]="!newForm.valid">
save
</button>
my.component.ts:
ngOnInit() {
this.newForm = new FormGroup({
deadline: new FormControl('', Validators.compose([
Validators.required,
Validators.pattern('[0-9]{4}-[0-9]{2}-[0-9]{2}')
]))
});
}
我怎样才能做到这一点?
【问题讨论】:
-
你能添加一个 plunker 来展示这种行为吗? here's a template to get started
标签: android html angular firefox angular2-forms