Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AO3-6566 ARIA controls must contain the exact ID #4590

Merged
merged 1 commit into from
Jan 28, 2024

Conversation

neuroalien
Copy link
Contributor

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-6566

Purpose

What does this PR do?

Correctly declare the ID of the element controlled by the link to modal.

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.

Testing Instructions

How can the Archive's QA team verify that this is working as you intended?

If you have a Jira account with access, please update or comment on the issue
with any new or missing testing instructions instead.

References

Are there other relevant issues/pull requests/mailing list discussions?

Credit

What name and pronouns should we use to credit you in the Archive of Our Own's Release Notes?

If you have a Jira account, please include the same name in the "Full name"
field on your Jira profile, so we can assign you the issues you're working on.

Please note that if you do not fill in this section, we will use your GitHub account name and
they/them pronouns.

@neuroalien neuroalien force-pushed the AO3-6566-aria-controls-modal-id branch from 145e9ad to 04dd573 Compare August 2, 2023 20:53
Copy link
Collaborator

@sarken sarken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question/suggestion, but otherwise looks good!

@@ -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], "aria-controls" => "modal" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still need the old hash rocket syntax or does html_options = { class: "#{options[:class]} modal", title: options[:title], aria: { controls: "modal" } } work?

And it's okay if you don't know the answer to this, but any idea why we set the aria-controls attribute here and in the JavaScript? It seems like the JavaScript is overwriting this: if I just change it here and I check the modals in, e.g., the symbols block on blurbs or anywhere on the search pages, the modal links still have whatever aria-controls is set in the JavaScript.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure there's no need for the old syntax for the first two keys, but I didn't know you could nest aria keys like that. I also wasn't sure if we wanted to do piecemeal syntax updates, or if that would open a whole can of worms. 😅

Is it meant to work without JavaScript? No clue. 🤷

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without JavaScript, the modal definitely won't work -- it should just fall back to being a plain link, but I haven't tested it to see if that's wishful linking -- so including the ARIA attribute is pretty much unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

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.
@CristinaRO CristinaRO force-pushed the AO3-6566-aria-controls-modal-id branch from 04dd573 to 8095b45 Compare October 29, 2023 20:29
@sarken sarken merged commit 2a7150b into otwcode:master Jan 28, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants