fix: caps-lock warning stuck on linux (@fehmer) (#7195)

Just pressing caps-lock on linux (firefox, chrome) activates the
caps-lock warning but does not clear the caps-lock warning until
pressing another key.
This commit is contained in:
Christian Fehmer 2025-12-10 21:13:27 +01:00 committed by GitHub
parent d1011bd1f5
commit 64a0bdc3e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,9 +22,13 @@ function hide(): void {
}
function update(event: JQuery.KeyDownEvent | JQuery.KeyUpEvent): void {
const modState = event?.originalEvent?.getModifierState?.("CapsLock");
if (modState !== undefined) {
capsState = modState;
if (event?.originalEvent?.key === "CapsLock" && capsState !== null) {
capsState = !capsState;
} else {
const modState = event?.originalEvent?.getModifierState?.("CapsLock");
if (modState !== undefined) {
capsState = modState;
}
}
try {