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

Multiselect within DataGrid cell #3075

Closed
2 tasks done
jamintz opened this issue Nov 2, 2021 · 2 comments
Closed
2 tasks done

Multiselect within DataGrid cell #3075

jamintz opened this issue Nov 2, 2021 · 2 comments
Labels
plan: Pro Impact at least one Pro user support: question Community support but can be turned into an improvement

Comments

@jamintz
Copy link

jamintz commented Nov 2, 2021

Order ID 💳

21172

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Summary 💡

I'm trying to implement a multi-select within a DataGrid column. Following the advice here I implemented it using Autocomplete. Functionally it pretty much works, but I'm looking for some suggestions or help on styling.

The problem in depth 🔍

Specifically, it looks OK when only one or two items are selected:
Screen Shot 2021-11-02 at 2 29 48 PM

However, when a bunch are added the select arrow drops further and further down and everything's trapped within the cell – no way to scroll lower etc. Changing the cell width allows more to be displayed at a time but I'm looking for a more general solution, that would hit a limit as well.
Screen Shot 2021-11-02 at 2 29 39 PM

Reproduction here: https://codesandbox.io/s/renderratingeditcellgrid-material-demo-forked-te5iw?file=/demo.js

Context 🔦

It'd be useful to have a nice looking multi-select

Your environment 🌎

"@mui/icons-material": "^5.0.4",
"@mui/lab": "^5.0.0-alpha.51",
"@mui/material": "^5.0.4",
"@mui/styles": "^5.0.1",
"@mui/x-data-grid-generator": "^5.0.0-beta.4",
"@mui/x-data-grid-pro": "^5.0.0-beta.4",

@jamintz jamintz added plan: Pro Impact at least one Pro user support: question Community support but can be turned into an improvement status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 2, 2021
@m4theushw
Copy link
Member

You have to use a Portal to allow the Autocomplete to exceed the cell boundaries. In #2851 (comment) I showed how to create a textarea-like component with this capability. The approach is the same here.

@m4theushw m4theushw removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 2, 2021
@jamintz
Copy link
Author

jamintz commented Nov 2, 2021

Perfect, thanks

@jamintz jamintz closed this as completed Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plan: Pro Impact at least one Pro user support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

2 participants