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

Support inverted display of suggestions #68

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

danwild
Copy link

@danwild danwild commented Mar 7, 2018

Nice plugin thanks 👍

This PR adds optional params:

  • parentElementId {String} - to specify the parent div to append autocomplete (defaults to body)
  • invertScroll {Boolean} - to ensure suggestions at the bottom of the list are scrolled into view first

The addition of these options allows us to use this plugin for inverted display of suggestions.
Why? If you try and use this in a footer it doesn't work so well - because there is no room to display the suggestions below.

Here's how it works now, with inverted options (and some css tweaks):

autocomplete

@michael-ts
Copy link

I'm not sure if I'm using this wrong, but I can't get it to work.
First of all, I had to define an element with an id "body". Not sure why this was necessary, as I had the stock version working without it. Somehow related to parentElementId?

Second, it still displays the dropdown below the input. My element is far enough from the bottom that I can still see the dropdown, but as it is about 75% down I would prefer to get the behavior shown above.

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

Successfully merging this pull request may close these issues.

2 participants