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

[Admin] Use aria-disabled for setting anchor buttons as disabled #5287

Merged
merged 4 commits into from
Jul 28, 2023

Conversation

elia
Copy link
Member

@elia elia commented Jul 27, 2023

Summary

Rely on ARIA-attributes instead of custom data-ui attributes for showing anchors as active or disabled in the ui/tab and ui/button components.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@elia elia self-assigned this Jul 27, 2023
@elia elia changed the base branch from main to nebulab/admin July 27, 2023 10:40
@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Merging #5287 (8ad4a62) into nebulab/admin (c50a3c8) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@                Coverage Diff                @@
##           nebulab/admin    #5287      +/-   ##
=================================================
- Coverage          88.52%   88.51%   -0.01%     
=================================================
  Files                597      597              
  Lines              14523    14518       -5     
=================================================
- Hits               12856    12851       -5     
  Misses              1667     1667              
Files Changed Coverage Δ
...pp/components/solidus_admin/ui/button/component.rb 100.00% <ø> (ø)
...n/app/components/solidus_admin/ui/tab/component.rb 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@elia elia marked this pull request as ready for review July 27, 2023 10:56
@elia elia requested a review from a team as a code owner July 27, 2023 10:56
@elia elia requested a review from the-krg July 27, 2023 12:56
@elia elia force-pushed the elia/admin/aria-disabled branch 2 times, most recently from 25af019 to 5f81491 Compare July 27, 2023 14:33
Copy link
Contributor

@rainerdema rainerdema left a comment

Choose a reason for hiding this comment

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

Thanks @elia 👍

Copy link
Contributor

@the-krg the-krg left a comment

Choose a reason for hiding this comment

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

💯

<form>
<%= render @tab_component.new(
text: "All",
'aria-current': true,
Copy link
Member

Choose a reason for hiding this comment

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

Now that the implementation (using a button under the hood) is hidden, can't we just treat the way we set is as active as an implementation detail? I think it makes more sense as it was before, with the active and disabled params determining the state of the button.

Copy link
Member Author

Choose a reason for hiding this comment

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

Active is still a state that cannot be controlled programmatically, so for that we still need another way to tap into it.

See https://developer.mozilla.org/en-US/docs/Web/CSS/:active#active_form_elements

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, sorry. For active, I meant selected (the current tab that is selected), not the activation on click.

@elia elia requested a review from kennyadsl July 27, 2023 15:35
@elia elia force-pushed the elia/admin/aria-disabled branch from 5f81491 to 5e359eb Compare July 27, 2023 15:36
@elia elia force-pushed the elia/admin/aria-disabled branch from 5e359eb to 8ad4a62 Compare July 27, 2023 16:08
@kennyadsl kennyadsl merged commit 415d77e into nebulab/admin Jul 28, 2023
4 checks passed
@kennyadsl kennyadsl deleted the elia/admin/aria-disabled branch July 28, 2023 07:11
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.

4 participants