我正在表单内显示单选按钮的自定义 View ,并使用标签属性进行切换。 Ionic2 本身消除了 anchor 和按钮上的 300 毫秒延迟,但我不确定如何消除标签上的点击延迟。
如何消除标签单击上的延迟或以不同的方式实现此延迟,以便我可以切换 radio ?
<input type="radio" id="{{input.key}}.{{i}}" name="{{input.key}}"
(change)="radioSelectionChanged(subinput,input)"
[checked]="subinput.selected">
<label *ngIf="!macroCodeProvider.isEqualType(input.type,configInputType.Select)"
class=""
for="{{input.key}}.{{i}}">
{{subinput.label}}
</label>
最佳答案
我添加这个答案只是为了以防万一这可以帮助其他一些 SO 用户。就像您在 docs 中看到的那样
[...], you may need to add a (click) event to an element that is not normally clickable. When you do this you may experience a 300ms delay from the time you click the element to the event firing. To remove this delay, you can add the tappable attribute to your element.
<div tappable (click)="doClick()">I am clickable!</div>
因此,通过向目标元素添加 tappable
属性(和点击事件),您可以消除 300 毫秒的延迟。
关于javascript - Ionic2 禁用标签元素上的 300 毫秒延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42979788/