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

[XGrid] Close column header menu when resizing column #1989

Merged
merged 23 commits into from
Jul 7, 2021

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Jun 28, 2021

@flaviendelangle flaviendelangle self-assigned this Jun 28, 2021
@flaviendelangle flaviendelangle marked this pull request as draft June 28, 2021 16:14
@flaviendelangle
Copy link
Member Author

I did not find tests about this menu so I created a new file
But we may want to test the basic features of this menu and not just the behavior modified in this PR

@flaviendelangle flaviendelangle marked this pull request as ready for review June 29, 2021 08:33

const separator = columnCell.querySelector('.MuiDataGrid-iconSeparator');
fireEvent.mouseDown(separator);
// TODO remove mouseUp once useGridColumnReorder will handle cleanup properly
Copy link
Member

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));
Copy link
Member

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.

Copy link
Member Author

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

@flaviendelangle flaviendelangle merged commit 55972c6 into mui:master Jul 7, 2021
@flaviendelangle flaviendelangle deleted the resize-column-close-menu branch July 7, 2021 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[XGrid] Resizing a column does not close the menu
4 participants