﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31522	FilteredSelectMultiple widget jumps to top when an option is added.	Shai Berger	TapanGujjar	"When using a FilteredSelectMultiple as a widget for a MultipleChoice field, typically the list of options is longer than what fits in the control. If the user then scrolls down, selects some options, and clicks the arrow to move them to the ""chosen"" box, then they are correctly added, but the ""available"" box scrolls to the top.

It would be much nicer if the ""available"" box stayed where it was.

At [https://www.matific.com Matific] where we encountered this, we monkeypatched the control's media to add a JavaScript file with this code:
{{{
(function($){
    if(!SelectBox)
        return;

    var oldRedisplay = SelectBox.redisplay;

    if(typeof oldRedisplay !== 'function')
        return;

    SelectBox.redisplay = function(id) {
        var top = $('#'+id).scrollTop(); //record current scroll
        var res = oldRedisplay.apply(this, arguments);
         $('#'+id).scrollTop(top); // Restore the scroll
        return res;
    };
})(django.jQuery);
}}}

I'm attaching a minimal project to demonstrate it."	Cleanup/optimization	closed	contrib.admin	dev	Normal	fixed		TapanGujjar	Ready for checkin	1	0	0	0	1	1
