JQuery Chosen Prevents Auto Vertical Scrolling

I recently discovered jQuery Chosen functionality that automatically scrolls the .chosen-results Container container down when you hang the bottom of the container.

Problem

I already found a function (result_do_highlight) that does this: here

This is the part in which the function scrolls automatically:

if high_bottom >= visible_bottom @search_results.scrollTop if (high_bottom - maxHeight) > 0 then (high_bottom - maxHeight) else 0 else if high_top < visible_top @search_results.scrollTop high_top 

Is there a way to prevent scrolling?

Thank you in advance

EDIT

I forked Chosen- git and added a workaround: github.com/puresamari/chosen

here's how to use it:

Changes by

I added funtionallity to disable automatic scrolling to the highlighted option: Use it like this:

 $('your_select').chosen({ scroll_to_highlighted: false }); 

iscroll_to_highlighted 'parameter is optional and defaults to true

+5
source share
1 answer

I unlocked Chosen- git and added a workaround: github.com/puresamari/chosen

here's how to use it:

Changes by

I added funtionallity to disable automatic scrolling to the highlighted option: Use it like this:

 $('your_select').chosen({ scroll_to_highlighted: false }); 

iscroll_to_highlighted 'parameter is optional and defaults to true

+3
source

Source: https://habr.com/ru/post/1242092/


All Articles