HTML5& quot;数字& quot;输入输入-向上/向下箭头不精确的点击错误 [英] HTML5 "number" type inputs - up/down arrow imprecise click bug

查看:35
本文介绍了HTML5& quot;数字& quot;输入输入-向上/向下箭头不精确的点击错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

道歉的道歉.我们今天发现,在HTML5数字输入上单击向上"箭头的周界附近将在第一次单击时触发向上"箭头上的事件,但随后的每次单击都会在向下"箭头上触发事件.

Apologies for the title-gore. We discovered today that clicking near the perimeter of the "up" arrow on an HTML5 number input will trigger an event on the "up" arrow on the first click, but trigger events on the "down" arrow with every subsequent click.

这里是一个单行小提琴,演示了此问题.我能够在Chrome 59中一致地重现该错误.

Here's a one line fiddle that demonstrates the issue. I am able to reproduce the bug consistently in Chrome 59.

<input type="number" />

将光标移至数字输入的向上"箭头的顶部边缘,然后单击几次.可能需要几次尝试才能将光标放在正确的位置.第一次单击将触发向上箭头,但随后的每次单击将触发向下箭头.

Move your cursor to the top edge of the number input's "up" arrow and click several times. It may take a few tries to get the cursor in the right place. The first click will trigger the up arrow, but every subsequent click will trigger the down arrow.

这是否是由Chrome进行某种类型的点击事件模糊处理所引起的,目的是协助极小的误点击?我在这里很迷路.

Is this caused by some type of click event fuzzing done by Chrome in an effort to assist with extremely minor misclicks? I'm pretty lost here.

注意:我尝试在Edge和Firefox中进行复制,但未成功.这可能只需要转到Chrome小组.

Note: I attempted to reproduce in Edge and Firefox but was unsuccessful. This may just need to go to the Chrome team.

推荐答案

这是一个错误.如果愿意,可以在 https://bugs.chromium.org 中进行报告.

This is a bug. You can report it at https://bugs.chromium.org if you like.

要点是这样的:链接到下面的代码包含类似

The gist is this: The code linked to below contains logic like

if (is_pressed) {
    if (spin_up_pressed) {
        highlight spin up
    } else {
        highlight spin down
    }
}

显然不完全正确.

https://cs.chromium.org/search/?q = spin_up%7CSpinUp + f:theme& type = cs

这篇关于HTML5&amp; quot;数字&amp; quot;输入输入-向上/向下箭头不精确的点击错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆