admin管理员组文章数量:1314442
If you're in the latest version of Chrome, or in a Webkit nightly build, you'll notice that password fields have a nice new caps lock indicator baked right into the browser itself.
As far as I can tell, there does not appear to be any style changes related to this indicator. As such, I am having no luck finding a way to disable it, as our pany uses a styled JavaScript solution for cross-browser caps-lock indicators.
Does anyone know of a way to disable this indicator in Webkit browsers?
If you're in the latest version of Chrome, or in a Webkit nightly build, you'll notice that password fields have a nice new caps lock indicator baked right into the browser itself.
As far as I can tell, there does not appear to be any style changes related to this indicator. As such, I am having no luck finding a way to disable it, as our pany uses a styled JavaScript solution for cross-browser caps-lock indicators.
Does anyone know of a way to disable this indicator in Webkit browsers?
Share Improve this question asked Nov 5, 2012 at 19:23 user1191002user1191002 5-
Does
-webkit-appearance: none
ortextfield
solve anything? I don't have a browser to test, but that's my best guess. – apsillers Commented Nov 5, 2012 at 19:32 - that's what i would suggest as per quackit./css/properties/webkit/css_-webkit-appearance.cfm – user428517 Commented Nov 5, 2012 at 19:35
- @apsillers Nope. This appears to not be set via any webkit style attributes. – user1191002 Commented Nov 5, 2012 at 19:45
- What version exactly, and what OS? I just looked at Chrome Canary (25) and the latest nightly Chromium on Windows 7 and couldn't get a caps lock indicator to e up on password fields. – josh3736 Commented Nov 5, 2012 at 19:50
- @josh3736 Interesting. I'm on OSX and it shows in Chrome 22, Chrome Canary 23, and last night's Webkit nightly build. So I assume the next build of Safari will also have this present. – user1191002 Commented Nov 5, 2012 at 19:59
4 Answers
Reset to default 5Adding a caps lock indicator to password text inputs is actually a feature of Mac OS X, not something specific to Chrome/Webkit. In Windows and Linux versions of Chrome, there is no caps lock indicator.
I did find that adding display: block
to the password field caused the indicator to go away in both Chrome and Safari. However, given the fact that display
has absolutely nothing to do with a caps lock indicator, I'd consider this an implementation detail (borderline bug) that is likely to be fixed in the future.
for what is worth 5 yrs later, I've solved it by setting
input::-webkit-caps-lock-indicator {
content: none;
}
Might not be the cleanest solution but does the job;
The feature is not scriptable from JavaScript. It's inside the browser code itself. There may be a setting in the browser for it, but web pages have zero control over it.
I think looking at -webkit-appearence: caps-lock-indicator
could help you to solve this issue.
本文标签: javascriptDisable caps lock indicator on Webkit browsersStack Overflow
版权声明:本文标题:javascript - Disable caps lock indicator on Webkit browsers - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741970561a2407811.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论