scriptaculous icon indicating copy to clipboard operation
scriptaculous copied to clipboard

Improved scrolling on Autocompleter when necessary

Open speckins opened this issue 14 years ago • 0 comments

Extends Element with .scrollIntoViewIfNecessary() which only scrolls the parent container if the element is not already entirely within view. This solves two related issues for Autocomplete dropdowns when there are scrollbars. First, if the user changes direction while scrolling through the choices, the selected LI jumps from the bottom to the top (or vice versa) of the dropdown. Second, when the autocomplete element is within a containing element with its own scrollbars, using scrollIntoView would scroll the outer scroll bars, moving the LI.selected to the top and obscuring the INPUT element. This fixes both of those problems.

I can supply a demo page if it would better illustrate.

speckins avatar Apr 12 '12 02:04 speckins