javascript - Ionic2 禁用标签元素上的 300 毫秒延迟

标签 javascript angularjs ionic2

我正在表单内显示单选按钮的自定义 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/

相关文章:

Javascript合并/减少相同的多维对象

angular - Ionic serve 404 未能加载 main.js 和 main.css 资源

javascript - ionic2登录后如何将菜单按钮显示到另一个页面

javascript - 我无法删除数组的最后一项

javascript - 提交联系回复到电子邮件

javascript - 查找元素在 javascript 对象中的位置

javascript - angularjs 应用程序中的 HTML 5 url

javascript - 编辑对传递参数的引用不会更新模型

javascript - ngclass 表达式,是数组中的值

javascript - ionViewWillEnter错误: URI malformed