diff --git a/frontend/src/scripts/test/focus.ts b/frontend/src/scripts/test/focus.ts index 2d34e247c..dfb880c90 100644 --- a/frontend/src/scripts/test/focus.ts +++ b/frontend/src/scripts/test/focus.ts @@ -1,6 +1,7 @@ import * as Caret from "./caret"; import * as ActivePage from "../states/active-page"; +const unfocusPx = 3; let state = false; export function set(foc: boolean, withCursor = false): void { @@ -28,7 +29,9 @@ $(document).mousemove(function (event) { if ( $("#top").hasClass("focus") && event.originalEvent && - (event.originalEvent.movementX > 0 || event.originalEvent.movementY > 0) + // To avoid mouse/desk vibration from creating a flashy effect, we'll unfocus @ >5px instead of >0px + (event.originalEvent.movementX > unfocusPx || + event.originalEvent.movementY > unfocusPx) ) { set(false); }