-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[XGrid] Close column header menu when resizing column #1989
[XGrid] Close column header menu when resizing column #1989
Conversation
I did not find tests about this menu so I created a new file |
packages/grid/_modules_/grid/hooks/features/columnResize/useGridColumnResize.tsx
Outdated
Show resolved
Hide resolved
packages/grid/_modules_/grid/hooks/features/columnResize/useGridColumnResize.tsx
Outdated
Show resolved
Hide resolved
packages/grid/_modules_/grid/hooks/features/columnResize/useGridColumnResize.tsx
Outdated
Show resolved
Hide resolved
|
||
const separator = columnCell.querySelector('.MuiDataGrid-iconSeparator'); | ||
fireEvent.mouseDown(separator); | ||
// TODO remove mouseUp once useGridColumnReorder will handle cleanup properly |
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 will likely get this for free with a fix of #2007.
const menuIconButton = columnWithMenuCell.querySelector('button[aria-label="Menu"]'); | ||
|
||
fireEvent.click(menuIconButton); | ||
await waitFor(() => expect(screen.queryByRole('menu')).not.to.equal(null)); |
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.
Ideally, we wouldn't need for an await
but it's not obvious how we could make it happen. Maybe we would need to disable the transition in the render factory helper, or to mock the time. I'm raising the point because await often lead to slower and less reliable tests. Anyway, not a blocker.
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.
I'm also in favor of fixing this behavior in a later PR to avoid blocking this one
Closes #1931
Preview: https://deploy-preview-1989--material-ui-x.netlify.app/components/data-grid/columns/#resizing