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: Allow left arrow to scroll buttons.

Karl Stolleyb4fe3fa37b5d
diff --git a/web/src/compose_state.ts b/web/src/compose_state.ts
index 725c4929f4b..090ca525fa3 100644
--- a/web/src/compose_state.ts
+++ b/web/src/compose_state.ts
@@ -148,6 +148,15 @@ function cursor_at_start_of_whitespace_in_compose(): boolean {
return message_content() === "" && cursor_position === 0;
}
+export function focus_in_formatting_buttons(): boolean {
+ const is_focused_formatting_button =
+ document.activeElement?.classList.contains("compose_control_button");
+ if (is_focused_formatting_button) {
+ return true;
+ }
+ return false;
+}
+
export function focus_in_empty_compose(
consider_start_of_whitespace_message_empty = false,
): boolean {
diff --git a/web/src/hotkey.js b/web/src/hotkey.js
index ed64526413d..ff0e75596fb 100644
--- a/web/src/hotkey.js
+++ b/web/src/hotkey.js
@@ -936,6 +936,9 @@ export function process_hotkey(e, hotkey) {
} else if (overlays.streams_open()) {
stream_settings_ui.toggle_view(event_name);
return true;
+ } else if (compose_state.focus_in_formatting_buttons()) {
+ // Allow left arrow to scroll the formatting buttons backward
+ return false;
}
message_edit.edit_last_sent_message();