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

Inside overflow: scroll container => suggestions not overlapping the container #99

Open
JaySunSyn opened this issue Dec 4, 2017 · 9 comments

Comments

@JaySunSyn
Copy link
Contributor

JaySunSyn commented Dec 4, 2017

How to use paper-autocomplete inside a scrollable container?

e.g. inside paper-dialog-scrollable the suggestions are not overlapping the dialog:

image

Thanks.

@ndormont
Copy link

ndormont commented Dec 4, 2017

@JaySunSyn , what's the issue?
Is it because the suggestions are not overlapping the dialog?
I have auto-complete paperchips in a dialogs, works just fine - but I see where you might have an issue if the filter input is too low, then the suggestion would be hidden/not shown, because they would be loaded inside the scrollable div.

@JaySunSyn
Copy link
Contributor Author

JaySunSyn commented Dec 4, 2017

@ndormont yes, the issue is that the suggestions are not overlapping the dialog.

A paper-dropdown-menu for example does overlap the the scrollable dialog:

image

paper-autocomplete in a scrollable dialog:

image

paper-autocomplete works just fine in a non-scrollable dialog:

image

@ndormont
Copy link

ndormont commented Dec 4, 2017

I had the same issue with a overflow: hidden div. I solved it by changing it to overflow: visible - but in your case, you have an issue because you want it to be scrollable. I wonder, does paper-dropdown-menu uses z-index for their suggestions!?

@JaySunSyn
Copy link
Contributor Author

Yes, indeed, I need it to be scrollable.

paper-dropdown-menu uses iron-dropdown uses position: fixed and z-index

@JaySunSyn JaySunSyn changed the title Inside overflow: scroll container Inside overflow: scroll container => not overlapping the container Dec 4, 2017
@JaySunSyn
Copy link
Contributor Author

This would work I guess:

paper-autocomplete {
  --paper-autocomplete-suggestions-wrapper: {
    position: fixed;
    width: initial;
  }
}

@JaySunSyn
Copy link
Contributor Author

Still think that position: fixed should be the default.

@JaySunSyn JaySunSyn changed the title Inside overflow: scroll container => not overlapping the container Inside overflow: scroll container => suggestions not overlapping the container Dec 8, 2017
@jhuesos
Copy link
Collaborator

jhuesos commented Dec 8, 2017 via email

@ainvaltin
Copy link

I guess this is kind of the same problem so I won't open new issue but comment here - even when the paper-autocomplete input is near the bottom edge of the browser the autocomplete list opens below it and is not completely visible (see the picture):

acpopup

when navigating with keyboard the selection goes "out of view" and is thus pretty unusable.

The paper-dropdown-menu seems to manage always to figure out good height for the popup, so that it is always completely visible. Then again, it uses scrollbars in the popup even when there would be enough room to show all the items...

Vaadin ComboBox has a nice feature that when it is near the bottom edge of the browser it opens it popup list above the input, not below it.

So perhaps borrowing some ideas from these two would help to make a perfect popup list :)

@bstmedia
Copy link

This would work I guess:

paper-autocomplete {
  --paper-autocomplete-suggestions-wrapper: {
    position: fixed;
    width: initial;
  }
}

It worked for me. I would suggest to close this issue

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

5 participants