-
Notifications
You must be signed in to change notification settings - Fork 161
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
Add elastic position strategy to igxOverlay #2697
Comments
igxDropDown has no default height. If you do not set height for your igxDropDown it will render without scrollbar. To fix this set height of the drop down, either in markup or in code behind like this:
this.igxDropDown.height = '400px'; If you set this in code behind nice place to place it is in OnInit event handler. |
Yes, that solution works but it would not work very well for mobile. I tried setting the height to 100% and it did not works. Should the dropdown be responsive? |
If you set the height to 100% this should not work too. IgxDropDown uses IgxOverlayService to show itself. What overlay does it next. It takes the drop down items container. Measures its size. Creates host element. Positions the host element and puts the drop down items container inside it. When you set 100% height the container of drop down items returns the total height of all items - this is the same as to leave the drop down without height. If you want to go with 100% you may put drop down items in a container with predefined height like this:
However this is the same as to set the drop down height to 200 px. |
One responsiveness that i was expecting of the dropdown is that if the field is the last element of the page then it does not show as expected. For example Example Dropdwon bottom page Also that if the content of the overlay is not visible on the screen the container will adjust automatically and/or have a scroll. I will use your suggested workaround. |
We have investigated this additionally. Right now igxOverlay service is able to position content in three ways:
What you need is something like elastic position strategy - this should be like connected, but should resize element if it does not fit on the screen. This is something we do not have right now. Can you please rename your issue to something like 'Add elastic position strategy to igxOverlay'? |
Done. |
We are starting to work on this now. What we plan to implement is a new position strategy in IgxOverlayService. This new strategy, elastic positioning, should be able according to provided min height and min width to resize the shown component, so it can fit as much as possible on the screen. This new strategy should extend connected position strategy. The new positioning will be applied only to components which goes out of the view. As a result of applying this new strategy shown component may draw horizontal and/or vertical scroll bar(s). |
…oning-strategy Elastic positioning strategy, #2697
Description
Add elastic position strategy to igxOverlay.
Steps to reproduce
Result
Scroll does not appears when exists many options and the dropdown is not fully visible.
Expected result
If the dropdown is the last element of the page then it adjust automatically in order to be shown.
Also that if the content of the overlay is not visible on the screen the container will have a scroll.
Attachments
dropdown-scroll.zip
The text was updated successfully, but these errors were encountered: