Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

compose_paste: Focus paste button on compose banner when shown.

Pratik Chanda8212f313e999
diff --git a/web/src/compose_paste.ts b/web/src/compose_paste.ts
index f28432eeac0..a8f5fbd2ae4 100644
--- a/web/src/compose_paste.ts
+++ b/web/src/compose_paste.ts
@@ -823,6 +823,13 @@ export function paste_handler(
// and also is required for undo, see above.
$banner.remove();
});
+ if (avoid_direct_paste) {
+ // Using focus({focusVisible: true}) here ensures that :focus-visible
+ // activates in Chrome.
+ $banner
+ .find(".main-view-banner-action-button.paste-to-compose")[0]
+ ?.focus({focusVisible: true});
+ }
}, 0);
}