3 ms·
It'd be nice to be able to do this without a keyboard event so that you should show an indicator in the password field that caps lock was on before they started
by spankalee 3y ago
It'd be nice to be able to do this without a keyboard event so that you should show an indicator in the password field that caps lock was on before they started typing.
- richwater 3y agoYou should be able to do this just fine with MouseEvents, and use `mouseup` or `mousedown` on the input box to trigger your "Caps On" icon, visible before the user starts typing. docs: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/getModifierState https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/...
- twiss 3y agoIt wouldn't even need to be an event on the input, it could be any key or mouse event on the document, including mousemove. That being said, I think it would be better if browsers would implement this; that would make it more efficient and more predictable.
- richwater 3y ago> mousemove True, but I was trying to avoid handlers being fired constantly. Just something to consider.
- berkes 3y agoIt could be an onFocus as well, I presume.
- stephenr 3y ago> so that you should show an indicator in the password field So I take it none of the OS/browser vendors besides Apple are doing this natively yet?