A11Y: Do not use positive tabindex in composer (#12563)

This commit is contained in:
Kris 2021-03-31 17:33:14 -04:00 committed by GitHub
parent 5a430e79b0
commit af879b7851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 12 deletions

View File

@ -1,7 +1,6 @@
import Button from "discourse/components/d-button"; import Button from "discourse/components/d-button";
export default Button.extend({ export default Button.extend({
tabindex: 5,
classNameBindings: [":btn-primary", ":create", "disableSubmit:disabled"], classNameBindings: [":btn-primary", ":create", "disableSubmit:disabled"],
title: "composer.title", title: "composer.title",
}); });

View File

@ -1,5 +1,4 @@
{{d-editor {{d-editor
tabindex="4"
value=composer.reply value=composer.reply
placeholder=replyPlaceholder placeholder=replyPlaceholder
previewUpdated=(action "previewUpdated") previewUpdated=(action "previewUpdated")

View File

@ -1,5 +1,4 @@
{{text-field value=composer.title {{text-field value=composer.title
tabindex="2"
id="reply-title" id="reply-title"
maxLength=titleMaxLength maxLength=titleMaxLength
placeholderKey=composer.titlePlaceholder placeholderKey=composer.titlePlaceholder

View File

@ -1,6 +1,5 @@
{{email-group-user-chooser {{email-group-user-chooser
id="private-message-users" id="private-message-users"
tabindex="1"
value=splitRecipients value=splitRecipients
onChange=(action "updateRecipients") onChange=(action "updateRecipients")
options=(hash options=(hash

View File

@ -20,8 +20,7 @@
model=model model=model
openComposer=(action "openComposer") openComposer=(action "openComposer")
closeComposer=(action "closeComposer") closeComposer=(action "closeComposer")
canWhisper=canWhisper canWhisper=canWhisper}}
tabindex=8}}
{{plugin-outlet name="composer-action-after" noTags=true args=(hash model=model)}} {{plugin-outlet name="composer-action-after" noTags=true args=(hash model=model)}}
{{#unless site.mobileView}} {{#unless site.mobileView}}
@ -37,7 +36,7 @@
{{#if canEdit}} {{#if canEdit}}
{{#link-to-input onClick=(action "displayEditReason") showInput=showEditReason icon="info-circle" class="display-edit-reason"}} {{#link-to-input onClick=(action "displayEditReason") showInput=showEditReason icon="info-circle" class="display-edit-reason"}}
{{text-field value=editReason tabindex="7" id="edit-reason" maxlength="255" placeholderKey="composer.edit_reason_placeholder"}} {{text-field value=editReason id="edit-reason" maxlength="255" placeholderKey="composer.edit_reason_placeholder"}}
{{/link-to-input}} {{/link-to-input}}
{{/if}} {{/if}}
</div> </div>
@ -60,7 +59,7 @@
}} }}
{{#if showWarning}} {{#if showWarning}}
<label class="add-warning"> <label class="add-warning">
{{input type="checkbox" checked=model.isWarning tabindex="3"}} {{input type="checkbox" checked=model.isWarning}}
{{i18n "composer.add_warning"}} {{i18n "composer.add_warning"}}
</label> </label>
{{/if}} {{/if}}
@ -75,7 +74,6 @@
<div class="category-input"> <div class="category-input">
{{category-chooser {{category-chooser
value=model.categoryId value=model.categoryId
tabindex="3"
onChange=(action (mut model.categoryId)) onChange=(action (mut model.categoryId))
isDisabled=disableCategoryChooser isDisabled=disableCategoryChooser
options=(hash options=(hash
@ -88,7 +86,6 @@
{{#if canEditTags}} {{#if canEditTags}}
{{mini-tag-chooser {{mini-tag-chooser
value=model.tags value=model.tags
tabindex=4
isDisabled=disableTagsChooser isDisabled=disableTagsChooser
onChange=(action (mut model.tags)) onChange=(action (mut model.tags))
options=(hash options=(hash
@ -140,7 +137,7 @@
disableSubmit=disableSubmit}} disableSubmit=disableSubmit}}
{{#if site.mobileView}} {{#if site.mobileView}}
<a href {{action "cancel"}} tabindex="6" title={{i18n "cancel"}} class="cancel"> <a href {{action "cancel"}} title={{i18n "cancel"}} class="cancel">
{{#if canEdit}} {{#if canEdit}}
{{d-icon "times"}} {{d-icon "times"}}
{{else}} {{else}}
@ -148,7 +145,7 @@
{{/if}} {{/if}}
</a> </a>
{{else}} {{else}}
<a href {{action "cancel"}} tabindex="6" class="cancel" >{{i18n "cancel"}}</a> <a href {{action "cancel"}} class="cancel" >{{i18n "cancel"}}</a>
{{/if}} {{/if}}
{{/unless}} {{/unless}}