ShowMaskonFocus在Angular中不适用于输入蒙版
我正在使用输入蒙版库,并希望实现时间格式的掩码。 它将接受HH:MM格式中的整数数字,因此以下面的形式使用它
timeInputMask = createMask({
mask: '[99:99]',
showMaskOnFocus: true,
showMaskOnHover:true
});
<input maxlength="5" placeholder="__:__" [inputMask]="timeInputMask" />
在加载文本框默认掩码后, 为“ :”,因此其工作正常。 问题是 - 一旦我单击文本框,掩码就隐藏了即文本框是空白的。开始键入编号后,掩码再次出现。
您知道我们如何使掩盖在He Textbox的焦点上可见吗?
I am using input-mask library and wanted to implement masking for time format. Which will accept integer numbers in HH:mm format so used this as below
timeInputMask = createMask({
mask: '[99:99]',
showMaskOnFocus: true,
showMaskOnHover:true
});
<input maxlength="5" placeholder="__:__" [inputMask]="timeInputMask" />
After loading a textbox default masking is coming as ":" so its working fine.
Problem is - as soon as I click inside the textbox, the masking is hiding i.e. text box is blank. After starts typing number the mask appears again.
Do you know how can we make masking visible on focus of he textbox?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里我使用 https://github.com/ngneat/input-mask 库。
*.html
*.ts
参考: https: //stackblitz.com/edit/angular-ivy-sp6w7d?file=src%2Fapp%2Fapp.component.html
Here i use https://github.com/ngneat/input-mask library.
*.html
*.ts
Ref: https://stackblitz.com/edit/angular-ivy-sp6w7d?file=src%2Fapp%2Fapp.component.html