-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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(v2): navbar dropdown opened with tab, not closing on click outside #3240
fix(v2): navbar dropdown opened with tab, not closing on click outside #3240
Conversation
Deploy preview for docusaurus-2 ready! Built with commit b145dde |
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
seems to work fine, what about a few code changes ?
@@ -61,6 +63,22 @@ function NavLink({ | |||
} | |||
|
|||
function NavItemDesktop({items, position, className, ...props}) { | |||
const dropDownRef = React.useRef<HTMLDivElement>(null); | |||
const dropDownMenuRef = React.useRef<any>(null); // TODO should find better solution for this. anything else will get a error when retrieve children. |
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.
Doesn't something like <UlHtmlElement | null>
works?
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.
packages/docusaurus-theme-classic/src/theme/NavbarItem/DefaultNavbarItem.tsx
Outdated
Show resolved
Hide resolved
It's okay. What code changes? |
optional chaining added and pushed again |
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.
CI fails
packages/docusaurus-theme-classic/src/theme/NavbarItem/DefaultNavbarItem.tsx
Outdated
Show resolved
Hide resolved
Problem of type checking solved by add type on focus() call site. |
thankss :) |
Motivation
There is a Problem on documentation of docusaurus with drop down in header.
it fixed in this pull request.
Have you read the Contributing Guidelines on pull requests?
Yes I read it.
Test Plan
Just start the project and check the drop down in navigation. press tab key from first and see that the drop down opens tab navigation navigate through it.