Material select append dropdown to body?


Topic: Material select append dropdown to body?

AVermeij pro asked 7 years ago

Hello MDB team, I am using various material selects in elements with fixed heights. To my understanding, dropdowns are currently always added to the parent element. This leads to overflow in my elements when opening dropdowns. I'm looking for a way to append the dropdowns to the body of the document instead. Is there an easy way to achieve this? As an example, selectize provides a dropdownParent option to achieve this: https://github.com/selectize/selectize.js/blob/master/docs/usage.md Cheers, André

Jakub Strebeyko staff answered 7 years ago

Hi there André, Welcome to the Support Board! You got it right, material select gets appended where it stands and there is no easy way to have it otherwise. The suggestion has been added for the Team to consider and perhaps we might see it in one of the upcoming releases. Thanks for your feedback! With Best Regards, Kuba

AVermeij pro answered 7 years ago

Hello Kuba, Thanks for your answer. Any hints to where I can take a look in mdb.js to make these modifications myself? Cheers, André

Jakub Strebeyko staff answered 7 years ago

Hi André, Feel free to fiddle with it at js/modules/src/material-select.js. To have your changes applied to all MDB boilerplates at ./html/, remember to compile it with npm run js-compile-plugins or yarn js-compile-plugins in the terminal at your project root directory. Full list of compilation / minification utilities can be found at ./package.json. With Best Regards, Kuba
Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No