Windows に AirPods 繋げて VC したかった
windows はクソ(暴論)
input
の maxlength
が空(null, undefined のとき)勝手に 0
になっていた[maxLength]
でのバインド[attr.maxlength]
を使う// app.component.ts import { Component } from "@angular/core"; @Component({ selector: "my-app", styleUrls: ["./app.component.scss"], templateUrl: "./app.component.html" }) export class AppComponent { public maxLength?: number; }
<!-- app.component.html --> OK: <input type="text" [attr.maxlength]="maxLength"><br><br> NG: <input type="text" [maxLength]="maxLength">
NGの方は maxLength="0"
でレンダリングされているため入力できない。
下記サンプルはv7だが、v11でも同様の現象を確認済み
max
やmin
の他の属性は大丈夫だったので地味な罠だった...🥺