-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
feat: collapsible categories #1128
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Deploy preview for docusaurus-preview ready! Built with commit 3814d17 |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Mind to patch this PR with some dummy subcategory so we can preview it on https://deploy-preview-1128--docusaurus-preview.netlify.com/ ? We will delete the test subcategory berfore merging (if approved) Update: https://deploy-preview-1128--docusaurus-preview.netlify.com/docs/en/next/installation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tsmrachel! I tweaked the icon to use a chevron and the orientation (points to the right when collapsed, and points down when collapsed). This is more inline with typical chevron behavior. We really like this feature, many thanks!
@@ -133,6 +146,29 @@ class SideNav extends React.Component { | |||
<script | |||
dangerouslySetInnerHTML={{ | |||
__html: ` | |||
var coll = document.getElementsByClassName('collapsible'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heyhey, is there any particular reason you're using var in favor of const/let?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code within <script>
is shipped as-is to browsers, and not all browsers understand let
. We stick to ES5 in such situations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for the clarification!
Motivation
#1084
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Tested against desktop browsers
Test Plan
Related PRs
Null