Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
message_edit: Fix Tab key order with DOM reordering and CSS.
Aman Agrawal74c9e820476f
diff --git a/web/styles/message_row.css b/web/styles/message_row.cssindex d2ddf9a1f0f..5620c225168 100644--- a/web/styles/message_row.css+++ b/web/styles/message_row.css@@ -1023,6 +1023,9 @@/* margin on either side to let the border of.edit-content-container show through. */margin: 0 1px;+ /* Display before Save/Cancel visually, even though+ it comes after them in the DOM (for Tab order). */+ order: -1;}.message_edit_save .loader {@@ -1072,6 +1075,12 @@}.edit-controls {+ /* Use flex column layout so that we can use `order`+ to keep the formatting buttons row visually above+ the Save/Cancel buttons, while the DOM order has+ Save/Cancel first for correct Tab key navigation. */+ display: flex;+ flex-direction: column;margin-left: 0;margin-top: 0;}diff --git a/web/templates/message_edit_form.hbs b/web/templates/message_edit_form.hbsindex 87e004eb63e..0c447361291 100644--- a/web/templates/message_edit_form.hbs+++ b/web/templates/message_edit_form.hbs@@ -17,17 +17,6 @@</div><div class="action-buttons"><div class="controls edit-controls">- {{#if is_editable}}- <div class="message-edit-feature-group compose-scrolling-buttons-container">- {{> compose_control_buttons . }}- <button type="button" class="formatting-control-scroller-button formatting-scroller-forward">- <i class="scroller-forward-icon zulip-icon zulip-icon-compose-scroll-right"></i>- </button>- <button type="button" class="formatting-control-scroller-button formatting-scroller-backward">- <i class="scroller-backward-icon zulip-icon zulip-icon-compose-scroll-left"></i>- </button>- </div>- {{/if}}<div class="message-edit-buttons-and-timer">{{#if is_editable}}<div class="message_edit_save_container">@@ -46,6 +35,17 @@<button type="button" class="message-actions-button message_edit_close"><span>{{t "Close" }}</span></button>{{/if}}</div>+ {{#if is_editable}}+ <div class="message-edit-feature-group compose-scrolling-buttons-container">+ {{> compose_control_buttons . }}+ <button type="button" class="formatting-control-scroller-button formatting-scroller-forward" tabindex="-1">+ <i class="scroller-forward-icon zulip-icon zulip-icon-compose-scroll-right"></i>+ </button>+ <button type="button" class="formatting-control-scroller-button formatting-scroller-backward" tabindex="-1">+ <i class="scroller-backward-icon zulip-icon zulip-icon-compose-scroll-left"></i>+ </button>+ </div>+ {{/if}}</div></div></form>