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

Fix a bug with moderator dropdowns and add aria tags #13623

Merged

Conversation

Link2Twenty
Copy link
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Fix a bug with moderator dropdowns and add aria tags.

Related Tickets & Documents

closes #13318

QA Instructions, Screenshots, Recordings

forem_mod_dropdown--fix

UI accessibility concerns?

I'm not really sure what this is meant to do, it looks like it just greys out other dropdowns unless they're open but then still allows click actions to work.

Array.from(document.getElementsByClassName('other-things-btn')).forEach(
(btn) => {
btn.addEventListener('click', () => {
btn.classList.toggle('active');
const otherBtns = Array.from(
document.getElementsByClassName('other-things-btn'),
).filter((otherBtn) => otherBtn !== btn);
otherBtns.forEach((otherBtn) => {
otherBtn.classList.toggle('inactive');
});

Added tests?

  • Yes
  • No, and this is why: old tests will still work
  • I need help with writing tests

[optional] Are there any post deployment tasks we need to perform?

N/A

[optional] What gif best describes this PR or how it makes you feel?

slowing pushing things over

@Link2Twenty Link2Twenty requested a review from a team May 3, 2021 11:41
@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label May 3, 2021
@Link2Twenty Link2Twenty requested review from nickytonline and Ridhwana and removed request for a team May 3, 2021 11:41
@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2021

Thank you for opening this PR! We appreciate you!

For all pull requests coming from third-party forks we will need to
review the PR before we can process it through our CI pipelines.

A Forem Team member will review this contribution and get back to
you as soon as possible!

@Link2Twenty
Copy link
Contributor Author

Didn't realise this was connected to #12297
I've now added aria-haspopup as is indicated in that issue.

@rhymes rhymes changed the title Link2twenty/moderator toggle fix Fix a bug with moderator dropdowns and add aria tags May 5, 2021
Copy link
Contributor

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

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

Thanks as always @Link2Twenty for your contributions. Small change request.

app/assets/stylesheets/views/mod-actions.scss Outdated Show resolved Hide resolved
app/javascript/actionsPanel/actionsPanel.js Outdated Show resolved Hide resolved
@pr-triage pr-triage bot added PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes and removed PR: unreviewed bot applied label for PR's with no review labels May 5, 2021
@nickytonline nickytonline requested a review from aitchiss May 5, 2021 14:31
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes labels May 5, 2021
@aitchiss
Copy link
Contributor

aitchiss commented May 6, 2021

I'm not really sure what this is meant to do, it looks like it just greys out other dropdowns unless they're open but then still allows click actions to work.

I think you're right 🤔 It's strange but I guess maybe it helps visually to understand which dropdown is currently open? I'm not convinced though 😆

Copy link
Contributor

@aitchiss aitchiss left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for this. I tested locally, including with Safari/VoiceOver and the expanded/collapsed states are now being announced too ✨

@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels May 6, 2021
Copy link
Contributor

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes @Link2Twenty and thanks so much for making Forem more accessible! 🔥

@nickytonline nickytonline merged commit 3821438 into forem:main May 6, 2021
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels May 6, 2021
@Link2Twenty Link2Twenty deleted the Link2Twenty/moderator_toggle_fix branch May 6, 2021 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dropdown-options always open and lacks a11y
3 participants