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

[DataGrid] Ignore event from portal in cells #1324

Merged
merged 3 commits into from Apr 13, 2021

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Mar 31, 2021

Closes #1295.
Closes #1305.

This seems to cover all the issues. Assuming we will never add another source, maybe it's enough? Opened as a draft to run the CI and collect feedback.

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! labels Mar 31, 2021
@dtassone
Copy link
Member

it should be ok to have the event bubble to the grid container.

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Mar 31, 2021

I will add a regression test case if we agree with the approach. I didn't dive too much into the codebase, to try to find other events subscribed. What I did instead of click/key around to find any wrong behavior, couldn't spot any.

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Mar 31, 2021

We should probably link the React issue in the comment, for context.

@oliviertassinari oliviertassinari added the on hold There is a blocker, we need to wait label Apr 2, 2021
@oliviertassinari
Copy link
Member Author

I will wait for @dtassone to come back before continue the effort in the issue.

@dtassone
Copy link
Member

dtassone commented Apr 6, 2021

You should add a test for renderCell, and portals to make sure it works as expected but the approach looks correct

@oliviertassinari oliviertassinari removed the on hold There is a blocker, we need to wait label Apr 6, 2021
@oliviertassinari
Copy link
Member Author

Ok, will do such

@oliviertassinari oliviertassinari marked this pull request as ready for review April 10, 2021 20:52
@oliviertassinari oliviertassinari changed the title [DataGrid] Ignore portals [DataGrid] Ignore event from portal in cells Apr 10, 2021
@oliviertassinari
Copy link
Member Author

@dtassone done

@@ -57,4 +63,30 @@ describe('<DataGrid /> - Rows', () => {
expect(getColumnValues()).to.deep.equal(['Mike-11', 'Jack-11', 'Mike-20']);
});
});

it('should ignore events coming from a portal in the cell', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we have a test that shows events from a rendercell without portal

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well you check that the event is blocked with portal. I don't think we have a test that check if the event go through without portal.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I can add test coverage for this case.

@oliviertassinari
Copy link
Member Author

The React's issue: facebook/react#11387.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module!
Projects
None yet
2 participants