fix(desktop): preserve active element during automation press #5874
Closedmohamedmastouri-hue(GitHub profile, opens in a new tab)wants to merge 1 commit into
main fromrefs/pull/5874/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
- @@ -3032,3 +3043,5 @@30323043 // changing which thread is mounted in the UI. Restore the previous renderer30333044 // after dispatch so automation never leaves the app's input focus behind.30343045 yield* Effect.gen(function* () {3046+ if (previouslyFocused && previouslyFocused.id !== wc.id && !previouslyFocused.isDestroyed()) {3047+ yield* attempt(
- @@ -3032,3 +3043,15 @@30323043 // changing which thread is mounted in the UI. Restore the previous renderer30333044 // after dispatch so automation never leaves the app's input focus behind.30343045 yield* Effect.gen(function* () {3046+ if (previouslyFocused && previouslyFocused.id !== wc.id && !previouslyFocused.isDestroyed()) {3047+ yield* attempt(3048+ {3049+ operation: "automationPress.saveActiveElement",3050+ tabId,3051+ webContentsId: previouslyFocused.id,3052+ },3053+ () =>3054+ previouslyFocused.executeJavaScript(3055+ `if (document.activeElement && document.activeElement !== document.body) { window.__t3_restoreFocus = document.activeElement; } else { delete window.__t3_restoreFocus; }`,3056+ ),3057+ ).pipe(Effect.ignore);
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
1a096b32-9986-49d5-8cd2-ade7bc93489aYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share