Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
drafts: Use DOM order for keyboard navigation IDs.
Aman Agrawale1513c096af2
diff --git a/web/src/drafts_overlay_ui.ts b/web/src/drafts_overlay_ui.tsindex 849421dad12..614a269f640 100644--- a/web/src/drafts_overlay_ui.ts+++ b/web/src/drafts_overlay_ui.ts@@ -164,8 +164,15 @@ function update_rendered_drafts(const keyboard_handling_context: messages_overlay_ui.Context = {get_items_ids() {- const draft_arrow = drafts.draft_model.get();- return Object.getOwnPropertyNames(draft_arrow);+ const draft_ids: string[] = [];+ for (const row of document.querySelectorAll<HTMLElement>(+ "#drafts_table .overlay-message-row",+ )) {+ const id = row.dataset["draftId"];+ assert(id !== undefined);+ draft_ids.push(id);+ }+ return draft_ids;},on_enter() {// This handles when pressing Enter while looking at drafts.