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

bug: materialize select in modal #35

Open
roiLeo opened this issue Sep 23, 2020 · 8 comments
Open

bug: materialize select in modal #35

roiLeo opened this issue Sep 23, 2020 · 8 comments
Labels

Comments

@roiLeo
Copy link
Member

roiLeo commented Sep 23, 2020

Long select list in modal overflow

Current Behavior

Materialize select with multiple option change the modal height. We don't know if the select option has reached the end. Maybe it's missing some bottom margin ?

Possible Solution

The list could be overlapping the modal content or have a max-height.

Steps to Reproduce (for bugs)

  • create a materialize select and add multiple option in a modal

Environment

@roiLeo roiLeo added the bug Something isn't working label Sep 23, 2020
@nicknickel
Copy link

I've seen this issue as well. I got around it by adding overflow-y: visible; to the div with the modal class. I don't think that's a very elegant fix, though, since that breaks scroll on the modal so any content that's larger than the modal shows outside the modal. It only worked for me because the modal didn't have much content in it. There might be a fix with setting the z-index on the dropdown but I couldn't fine one that worked.

In any case, modals could probably be improved to handle the dropdown component better.

@Smankusors
Copy link
Member

the latest PR Dogfalo#6602 from Dogfalo's repo could be related though.

@Sorc96
Copy link

Sorc96 commented Oct 20, 2020

The solution is to specify the container for the Dropdown.

M.FormSelect.init(element, {
  dropdownOptions: {
    container: document.body
  }
}

Unfortunately, not all components that use a Dropdown accept dropdownOptions. I have been dealing with this problem in the case of Autocomplete. The mentioned PR in the old repo solves this. It would be nice to have this option added.

@Smankusors
Copy link
Member

I just realized that select component already have dropdownOptions property like @Sorc96 mentioned. So this issue is not bug, but more like the documentation need a example for this.

@roiLeo
Copy link
Member Author

roiLeo commented Feb 8, 2021

I've found the same problem with materialize Autocomplete component

Edit: nvm #60 is related

@wuda-io
Copy link
Member

wuda-io commented May 3, 2021

Can we close this?

@roiLeo
Copy link
Member Author

roiLeo commented May 3, 2021

Still need documentation fix about components that can be in container

@cmcknight
Copy link

I'm limiting the height of my dropdown by setting the .select-dropdown height,

.select-dropdown {
   height: 8rem;
   max-height: 8rem;
}

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

No branches or pull requests

7 participants