Closed dandv closed 9 years ago
:+1: +1 i'd be willing to have a go at this with a few suggestions from the creator...
You probably just want to amend the positionContainer
function in https://github.com/mizzao/meteor-autocomplete/blob/master/autocomplete-client.coffee to return a different position in this case.
It's not trivial how to do this; @dandv has spent a lot of time figuring out the caret position code, and what we basically want is the position of the first character in the input, instead of the caret. You may want to take a look at https://github.com/StockBase/meteor-caret-position as that is where the relevant logic lies, and update that package first.
ok cheers will give it a go later this week
@dandv could you try 0.4.9 and tell me if you like it better? You can check out a quick demo at http://autocomplete.meteor.com/.
@mizzao - thanks for making it so easy to try. Looks great! Re. your Sep 8 comment - wouldn't it be enough just to align the dropdown with the input box? (I haven't yet looked at how you implemented it, but maybe updating meteor-caret-position isn't necessary)
Yeah @cretep did that in #63 already, which is what's implemented now. It's probably better than aligning with the first character anyway.
For token-less inputs, where any character typed in will trigger the autocomplete menu, it seems to make sense to set the menu's
left
coordinate to theleft
of the input box. This is how the major search engines display the menu as well, and on narrow screens, this choice would reduce the chance that the menu scrolls off the right edge of the screen. This can be seen on our production autocomplete in the navbar at stockbase.com