Chrome自动移动焦点 [英] Chrome Automatically Moving Focus

查看:133
本文介绍了Chrome自动移动焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个特定于Chrome的问题;它将焦点从我的html输入移动到动态呈现形式的第一个用户元素。



示例:
HTML_SELECT_00
HTML_SELECT_01
INPUT_TEXT_00



问题:如果将光标置于INPUT_TEXT_00(使用鼠标),只要松开鼠标按钮,焦点将移回HTML_SELECT_00。如果您输入INPUT_TEXT_00,焦点不会被盗取,并按要求工作。

FF或IE7 / 8中不会发生此问题。只有在Chrome和我的版本是最新的。



我有两个事件挂钩到输入,onChange和onKeyPress。但是,这些事件并不是简单地通过将光标置于其中就触发的。



我希望有人以前看过这个。



问候,
Randall

解决方案

可能有一个标签封装了这三个元素。


Got an issue that is specific to Chrome; it's moving the focus from my html inputs to the first user element in a dynamically rendered form.

Example: HTML_SELECT_00 HTML_SELECT_01 INPUT_TEXT_00

Problem: If you place the cursor in INPUT_TEXT_00 (using the mouse), as soon as you let go of the mouse button, the focus will shift back to HTML_SELECT_00. If you tab into INPUT_TEXT_00, the focus does not get 'stolen', and works as desired.

This problem does not occur in FF or in IE7/8. Only in Chrome and my version is up-to-date.

I have two events hooked to the input, onChange and onKeyPress. However, those events are not triggered simply by placing the cursor in them.

I hope someone has seen this before; I've been searching all over for a resolution.

Regards, Randall

解决方案

There's probably a label wrapping the three elements.

这篇关于Chrome自动移动焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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