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

Render the listbox with a portal #52

Closed
phiter opened this issue Aug 17, 2023 · 2 comments · Fixed by #53
Closed

Render the listbox with a portal #52

phiter opened this issue Aug 17, 2023 · 2 comments · Fixed by #53
Assignees
Labels
enhancement New feature or request

Comments

@phiter
Copy link

phiter commented Aug 17, 2023

Describe the solution you'd like

Material UI renders its dropdown's listbox somewhere else in the page using a portal. This makes it possible to use the dropdown inside dialogs with it being able to overflow the dialog.

Example:
image

Currently in react-tag-autocomplete, this isn't possible, so if you use the component inside a dialog, it doesn't overflow properly.

In our application, the dropdown doesn't go over the dialog's footer, because the dialog's body has overflow: auto.

image

Using a portal to render the dropdown near the root element should allow this behavior.

@i-like-robots i-like-robots added the enhancement New feature or request label Aug 18, 2023
@phiter
Copy link
Author

phiter commented Aug 18, 2023

By the way, if this is implemented: #19, we can probably manage the positioning of the listbox ourselves and put it in a portal. The way it is right now it's impossible to do.

@i-like-robots i-like-robots self-assigned this Aug 19, 2023
@i-like-robots
Copy link
Owner

i-like-robots commented Aug 19, 2023

Thanks for the suggestion @phiter, this isn't something I'd considered. Utilising a portal for these cases makes sense.

Adding a custom renderer for the list box would be very straightforward and I believe would enable this. Would you be interested in contributing this change?

I would like to implement #19 in future but it's not currently on the horizon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants