From 3a18dd5681b20b99af6a9fefffe044670c7c0cdd Mon Sep 17 00:00:00 2001 From: Kris Date: Mon, 5 Apr 2021 14:36:43 -0400 Subject: [PATCH] Revert "A11Y: Do not use positive tabindex in composer (#12563)" (#12603) This reverts commit af879b7851e3c26b9a612dc7d76ca02c80a619c6. --- .../app/components/composer-save-button.js | 1 + .../app/templates/components/composer-editor.hbs | 1 + .../app/templates/components/composer-title.hbs | 1 + .../templates/components/composer-user-selector.hbs | 1 + .../discourse/app/templates/composer.hbs | 13 ++++++++----- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/composer-save-button.js b/app/assets/javascripts/discourse/app/components/composer-save-button.js index efa5d2bd773..4c7500d6402 100644 --- a/app/assets/javascripts/discourse/app/components/composer-save-button.js +++ b/app/assets/javascripts/discourse/app/components/composer-save-button.js @@ -1,6 +1,7 @@ import Button from "discourse/components/d-button"; export default Button.extend({ + tabindex: 5, classNameBindings: [":btn-primary", ":create", "disableSubmit:disabled"], title: "composer.title", }); diff --git a/app/assets/javascripts/discourse/app/templates/components/composer-editor.hbs b/app/assets/javascripts/discourse/app/templates/components/composer-editor.hbs index 28e4bdb3a3e..ea68f8598ee 100644 --- a/app/assets/javascripts/discourse/app/templates/components/composer-editor.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/composer-editor.hbs @@ -1,4 +1,5 @@ {{d-editor + tabindex="4" value=composer.reply placeholder=replyPlaceholder previewUpdated=(action "previewUpdated") diff --git a/app/assets/javascripts/discourse/app/templates/components/composer-title.hbs b/app/assets/javascripts/discourse/app/templates/components/composer-title.hbs index 2f4b7e3e129..c29ed22187d 100644 --- a/app/assets/javascripts/discourse/app/templates/components/composer-title.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/composer-title.hbs @@ -1,4 +1,5 @@ {{text-field value=composer.title + tabindex="2" id="reply-title" maxLength=titleMaxLength placeholderKey=composer.titlePlaceholder diff --git a/app/assets/javascripts/discourse/app/templates/components/composer-user-selector.hbs b/app/assets/javascripts/discourse/app/templates/components/composer-user-selector.hbs index 88e932fbb69..b18046a5d77 100644 --- a/app/assets/javascripts/discourse/app/templates/components/composer-user-selector.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/composer-user-selector.hbs @@ -1,5 +1,6 @@ {{email-group-user-chooser id="private-message-users" + tabindex="1" value=splitRecipients onChange=(action "updateRecipients") options=(hash diff --git a/app/assets/javascripts/discourse/app/templates/composer.hbs b/app/assets/javascripts/discourse/app/templates/composer.hbs index 49ef3f921a2..9a04fcc7860 100644 --- a/app/assets/javascripts/discourse/app/templates/composer.hbs +++ b/app/assets/javascripts/discourse/app/templates/composer.hbs @@ -20,7 +20,8 @@ model=model openComposer=(action "openComposer") closeComposer=(action "closeComposer") - canWhisper=canWhisper}} + canWhisper=canWhisper + tabindex=8}} {{plugin-outlet name="composer-action-after" noTags=true args=(hash model=model)}} {{#unless site.mobileView}} @@ -36,7 +37,7 @@ {{#if canEdit}} {{#link-to-input onClick=(action "displayEditReason") showInput=showEditReason icon="info-circle" class="display-edit-reason"}} - {{text-field value=editReason id="edit-reason" maxlength="255" placeholderKey="composer.edit_reason_placeholder"}} + {{text-field value=editReason tabindex="7" id="edit-reason" maxlength="255" placeholderKey="composer.edit_reason_placeholder"}} {{/link-to-input}} {{/if}} @@ -59,7 +60,7 @@ }} {{#if showWarning}} {{/if}} @@ -74,6 +75,7 @@
{{category-chooser value=model.categoryId + tabindex="3" onChange=(action (mut model.categoryId)) isDisabled=disableCategoryChooser options=(hash @@ -86,6 +88,7 @@ {{#if canEditTags}} {{mini-tag-chooser value=model.tags + tabindex=4 isDisabled=disableTagsChooser onChange=(action (mut model.tags)) options=(hash @@ -137,7 +140,7 @@ disableSubmit=disableSubmit}} {{#if site.mobileView}} - + {{#if canEdit}} {{d-icon "times"}} {{else}} @@ -145,7 +148,7 @@ {{/if}} {{else}} - {{i18n "cancel"}} + {{i18n "cancel"}} {{/if}} {{/unless}}