angular2-multiselect-dropdown icon indicating copy to clipboard operation
angular2-multiselect-dropdown copied to clipboard

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

Open clementcontet opened this issue 4 years ago • 11 comments

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

clementcontet avatar Jun 30 '21 09:06 clementcontet

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

freddidierRTE avatar Nov 10 '21 14:11 freddidierRTE

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

6amalgama9 avatar Jan 14 '22 16:01 6amalgama9

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.

JonRossEventus avatar Jan 17 '22 20:01 JonRossEventus

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

6amalgama9 avatar Feb 01 '22 19:02 6amalgama9

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

jaffbeto avatar Mar 08 '22 17:03 jaffbeto

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

jtweeks avatar Apr 04 '23 16:04 jtweeks

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.

jtweeks avatar Apr 04 '23 16:04 jtweeks

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.

Dragonnx54 avatar May 21 '23 01:05 Dragonnx54

is there a specific version to try this on?

On Sat, May 20, 2023 at 9:41 PM Dragonnx54 @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/CuppaLabs/angular2-multiselect-dropdown/issues/584#issuecomment-1556060336, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKPAJUZSMU6WENBQLJTI2DXHFXE3ANCNFSM47R7D57Q . You are receiving this because you commented.Message ID: @.***>

-- Jose Weeks 571.215.5045 @.***

jtweeks avatar May 21 '23 21:05 jtweeks

I tried this with Angular 14.2.0 and angular2 multiselect dropdown 5.0.4

Dragonnx54 avatar May 21 '23 23:05 Dragonnx54

ThanksSent on the go by JoseOn May 21, 2023, at 7:55 PM, Dragonnx54 @.***> wrote: I tried this with Angular 14.2.0 and angular2 multiselect dropdown 5.0.4

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

jtweeks avatar May 22 '23 12:05 jtweeks