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

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

问题描述

为标题血腥道歉。我们今天发现,在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.

https://jsfiddle.net/bm5r5yLf/

<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 上报告。

要点如下:链接到下面的代码包含逻辑,如

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:主题& type = cs

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

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