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: unbreak Details component #5364

Merged
merged 1 commit into from
Aug 17, 2021
Merged

fix: unbreak Details component #5364

merged 1 commit into from
Aug 17, 2021

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Aug 15, 2021

Motivation

After merge #5341 our custom component for details element no longer work correctly, so this PR rolls back changes made in that PR.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Current state (https://docusaurus.io/docs/markdown-features#details):

image

Expected one - fixed (https://deploy-preview-5364--docusaurus-2.netlify.app/docs/markdown-features#details):

image

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@lex111 lex111 added the pr: bug fix This PR fixes a bug in a past release. label Aug 15, 2021
@lex111 lex111 requested a review from slorber as a code owner August 15, 2021 18:43
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 15, 2021
@netlify
Copy link

netlify bot commented Aug 15, 2021

✔️ [V2]

🔨 Explore the source changes: 253065a

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/6119603cd5e62d0008e53d4e

😎 Browse the preview: https://deploy-preview-5364--docusaurus-2.netlify.app

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 97
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5364--docusaurus-2.netlify.app/

@lex111
Copy link
Contributor Author

lex111 commented Aug 15, 2021

@Josh-Cena this isn't the first time something is broken after your refactoring and I have to fix it, so please check your changes carefully, we don't have dedicated QA to check all incoming PRs, so it's very easy to break things!

@github-actions
Copy link

Size Change: -56 B (0%)

Total Size: 803 kB

Filename Size Change
website/build/assets/js/main.********.js 405 kB -50 B (0%)
ℹ️ View Unchanged
Filename Size Change
website/.docusaurus/globalData.json 36.2 kB 0 B
website/build/assets/css/styles.********.css 93.9 kB 0 B
website/build/blog/2017/12/14/introducing-docusaurus/index.html 65.3 kB 0 B
website/build/blog/index.html 34.2 kB 0 B
website/build/docs/index.html 43.1 kB -3 B (0%)
website/build/docs/installation/index.html 50.7 kB -3 B (0%)
website/build/index.html 29.8 kB 0 B
website/build/tests/docs/index.html 23.6 kB 0 B
website/build/tests/docs/standalone/index.html 21.6 kB 0 B

compressed-size-action

@Josh-Cena
Copy link
Collaborator

Josh-Cena commented Aug 16, 2021

Oops, didn't catch that, my bad 😅 Thanks for fixing, I will watch out more carefully next time

After some thinking I think the a11y is wrong in warning that details element is noninteractive because it is clickable. I did the refactor just because I'm tired of seeing all the warnings when I run yarn lint before committing, so in this case we should add eslint-disable

Edit. After some search I found out that actually <summary> is supposed to capture all the click events and it even has a button aria-role. I think we should bind the event listeners to <summary> instead, but since it's passed in as props, not sure how to do this

@lex111
Copy link
Contributor Author

lex111 commented Aug 16, 2021

Not all warnings reported by ESLint need actually be fixed. In my opinion, current implementation of details corresponds well with a11y.

@slorber
Copy link
Collaborator

slorber commented Aug 17, 2021

Thanks

My fault, I should have tested better the other PR, didn't think it would break anything

@slorber slorber merged commit ce92f30 into master Aug 17, 2021
@slorber slorber deleted the lex111/fix-details branch August 17, 2021 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants