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: re-implement #3856 to improve correctness #3865

Merged
merged 3 commits into from
Sep 16, 2024

Conversation

anthonyshew
Copy link
Contributor

@anthonyshew anthonyshew commented Sep 13, 2024

Summary

In #3856, I attempted to improve the correctness of role="separator" in useAriaPropsForRole, but @Conaclos pointed out that removing the PROPS that I did may not be a great way to go about it. Instead, this PR is flipping the boolean on those props to make them not required. I'm having trouble understanding the macro code (I've admittedly never read a macro's code) to see if this is the case. Tests are passing here, so it seems this is right, but appreciate your guidance. 🙏

@ematipico also pointed out that the most correct way to go about this would be to conditionalize the required-ness based on if the element is focusable. This was something I considered but didn't know how to go about. I'd be happy to attempt this but I might need some help or a pointer to a rule where a similar behavior is implemented to figure it out. Or, perhaps, is there a method somewhere to infer focusable-ness?

Test Plan

Test cases in valid.jsx and invalid.jsx.

@github-actions github-actions bot added the A-CLI Area: CLI label Sep 13, 2024
@anthonyshew anthonyshew changed the title fix: Re-implement #3856 to improve correctness. fix: re-implement #3856 to improve correctness Sep 13, 2024
@Conaclos
Copy link
Member

I'm having trouble understanding the macro code

You are not alone! I really dislike Rust macros. However, it is sometimes handy to have them.
By the way, the biome_aria crate is too complicated for what it does.

@ematipico
Copy link
Member

By the way, the biome_aria crate is too complicated for what it does.

True. I was a noob at Rust 😔

@anthonyshew
Copy link
Contributor Author

Heh, glad it's not just me then. Let me know what you all want me to do with this PR. Happy to leave as-is, ship as-is, or improve further.

@Conaclos Conaclos merged commit b2f3aaa into biomejs:main Sep 16, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants