compose: Allow left arrow to scroll buttons.

This commit is contained in:
Karl Stolley
2025-01-20 12:42:00 -06:00
committed by Tim Abbott
parent d14c3b7aac
commit b4fe3fa37b
2 changed files with 12 additions and 0 deletions

View File

@@ -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 {

View File

@@ -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();