-
-
Notifications
You must be signed in to change notification settings - Fork 142
[NavigationMenuTrigger] Fix positioner height when opening the list using the keyboard #2060
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
base: master
Are you sure you want to change the base?
[NavigationMenuTrigger] Fix positioner height when opening the list using the keyboard #2060
Conversation
commit: |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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 fix works correctly 👍
I'll let @michaldudak decide on the infra addition - we usually write our tests with Vitest browser mode with RTL if we need to calculate real sizes for in the browser at the moment (using skipIf(isJSDOM)
), which is why the e2e is largely empty
test/e2e/index.test.ts
Outdated
@@ -129,4 +132,48 @@ describe('e2e', () => { | |||
await expect(screen.getByTestId('three')).toHaveFocus(); | |||
}); | |||
}); | |||
|
|||
describe('<NavigationMenu />', () => { |
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.
This test can be added to our unit test suite. We run it in the browser using Vitest's browser mode (using Playwright under the hood).
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.
Nice! I just replaced the Playwright test with the unit test.
test/e2e/fixtures/NavigationMenu.tsx
Outdated
); | ||
} | ||
|
||
const triggerClassName = |
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.
We don't use Tailwind CSS in our tests. Also, we don't need all the bells and whistles in test code, only the minimum to verify the functionality.
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.
Good to know! code removed.
6c07dec
to
1ddf978
Compare
Bundle size report@base-ui-components/react parsed: 🔺+6B(0.00%) gzip: 🔺+4B(0.00%) Show details for 39 more bundles@base-ui-components/react/navigation-menu parsed: 🔺+6B(+0.01%) gzip: 🔺+5B(+0.02%) |
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.
There's an issue with the test after merging in the latest master. Could you explicitly import { expect } from 'chai';
in the test file?
packages/react/src/navigation-menu/trigger/NavigationMenuTrigger.test.tsx
Outdated
Show resolved
Hide resolved
…er.test.tsx Co-authored-by: Michał Dudak <[email protected]> Signed-off-by: Julio Merisio <[email protected]>
Signed-off-by: Julio Merisio <[email protected]>
Changes
handleOpenEvent(event)
call in the keyboard event handler for arrow key navigationhandleOpenEvent
to accept bothMouseEvent
andKeyboardEvent
typesBefore
before.mp4
After
after.mp4