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

When shown on top, dropdown is always positioned as if it were at its maximum height #584

Open
clementcontet opened this issue Jun 30, 2021 · 11 comments

Comments

@clementcontet
Copy link

Tested with angular2-multiselect-dropdown v5.0.4 and Angular v9, 10, 11 and 12.

When the dropdown is shown on top, if the data list is empty, the dropdown is positioned "floating" far above the input field.
This bizarre position matches the position that the dropbox would have if it were full of items.

bug

@freddidierRTE
Copy link

freddidierRTE commented Nov 10, 2021

I have a similar problem (angular2-multiselect-dropdown v5.0.4 and angular 12.2.10)

image

And it is ok when on the bottom

image

@6amalgama9
Copy link

I have a same problem as @freddidierRTE on same versions.

But temporary solution as set position to 'bottom' is not always appropriate. For example when multiselect lays on bottom of the page then it out of page zone and you cannot scroll it down to see.

Screenshot 2022-01-14 181353

@JonRossEventus
Copy link

JonRossEventus commented Jan 17, 2022

I fixed it with a little css hack for now

.dropdown-list .arrow-down + .list-area .lazyContainer {
    min-height:300px;
}

the hack/solution could be better if there were classes that informed which position was being used. That min-height needs to also match the max-height used.

@6amalgama9
Copy link

I fixed it with a little css hack for now

.dropdown-list .arrow-down + .list-area .lazyContainer {
    min-height:300px;
}

the hack/solution could be better if there were classes that informed which position was being used. That min-height needs to also match the max-height used.

For my opinion, it just solve the problem of too high position of dropDown list.
For example, if enableSearchFilter or enableCheckAll will be turned off it wiil be unnecessary spaces between dropdown list and select field. And if enableFilterSelectAll turn on and add this CSS hack wil be another position bug:
Screenshot 2022-02-01 163320-multi-with-filterSelectAll

Described in more detail here #605
And here my Stackblitz example - last multiselect is with this css hack

@jaffbeto
Copy link

jaffbeto commented Mar 8, 2022

I have the same css position bug. When i use position:'top', setting autoPosition: false, dont work for top only for bottom

image

A temporary solution is to use the position:'bottom', although that is not the use case I want to give it, since it breaks the UI, I have no other option until the bug is fixed.
image

@jtweeks
Copy link

jtweeks commented Apr 4, 2023

I see this behavior when I use ngIf. If the multiselect is on dom on init, the location is fine.

@jtweeks
Copy link

jtweeks commented Apr 4, 2023

So I haven't done the fix yet, but what needs to be done is this unfortunately. do a query of dom for arrow-down class. If it's there, the picker modal is top. Then get height of modal, get position of text field. set modal top to adjusted position in window.

@Dragonnx54
Copy link

I added the attribute tagToBody: false to the settings object and it worked for me, it no longer takes the full height. Give it a try.

@jtweeks
Copy link

jtweeks commented May 21, 2023 via email

@Dragonnx54
Copy link

I tried this with Angular 14.2.0 and angular2 multiselect dropdown 5.0.4

@jtweeks
Copy link

jtweeks commented May 22, 2023 via email

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

No branches or pull requests

7 participants