Bootstrap-3-Typeahead icon indicating copy to clipboard operation
Bootstrap-3-Typeahead copied to clipboard

Chrome issue when list is larger than screen height

Open vladicaku opened this issue 7 years ago • 5 comments

When using Chrome and the autocomplete list is larger than the screen height, clicking on the items which are positioned bellow the screen bottom does not do anything. However this does not happen when using Firefox.

For ex. lets have a list of suggested times (range 00:00 - 23:30). The last clickable item is 14:30, which is at the bottom of the screen (including the Windows 7 taskbar). Clicking on the items after 14:30 just scrolls the screen at the beginning.

list1

vladicaku avatar Jun 19 '17 08:06 vladicaku

I'm seeing this behavior with Chrome 68.0.3440.106 on Windows 7. Firefox 61.0.1 and IE 11 work as expected.

Any hints for a fix/workaround?

StreamingMeeMee avatar Aug 13 '18 18:08 StreamingMeeMee

Same problem here. Did you find a fix ? I'm thinking about 2 possible workarounds :

  • adding a max-height and overflow:scroll to the list for it not to go below the end of the page (it works well)
  • adding/removing a padding and the end of the page when the list is shown/removed (needs to be tested)

guv3n avatar Nov 21 '18 11:11 guv3n

Interesting note is that when don't actually click an item but place your mouse over it and hit the Enter key, it works..

guv3n avatar Nov 29 '18 16:11 guv3n

Same here, Scrolling out of the view down and click do not fire afterSelect. @guv3n tested --- * adding a max-height and overflow:scroll to the list for it not to go below the end of the page (it works well) ---- And it works well on desktop, but not always on mobile.

victorbosh avatar Feb 15 '19 21:02 victorbosh

Dirty hack that works for me: $(selector).typeahead({ stuff }).on('typeahead:select', function(obj, selected, name) { }).off('blur');

victorbosh avatar Feb 19 '19 20:02 victorbosh