Skip to content

Commit

Permalink
AO3-6566 ARIA controls must contain the exact ID (#4590)
Browse files Browse the repository at this point in the history
The ID of the modal controlled by the link to modal is `modal`. The hash
sign must not be included in the reference to the element.

As per Sarken's comment, I've removed the redundant setting of the aria
attribute in HTML options, since it's always overwritten by the
JavaScript.
  • Loading branch information
neuroalien authored Jan 28, 2024
1 parent 15e1cba commit 2a7150b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def link_to_modal(content = "", options = {})
options[:for] ||= ""
options[:title] ||= options[:for]

html_options = { "class" => options[:class] + " modal", "title" => options[:title], "aria-controls" => "#modal" }
html_options = { class: "#{options[:class]} modal", title: options[:title] }
link_to content, options[:for], html_options
end

Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/ao3modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ jQuery(document).ready(function() {
.append(img);

a.addClass('modal modal-attached')
.attr('aria-controls', '#modal')
.attr('aria-controls', 'modal')
.filter(function() {
return $(this).closest('.userstuff').length === 0;
}).click(function(event){
Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/ao3modal.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2a7150b

Please sign in to comment.