How can I get the selected item of an igCombo scrolled to the top of the opened combo when the combo is opened?
[ Combo Box | v ]
--------------------------------
Selected Item <=================
Non-selected item 1
Non-selected item 2
Hi Justin,
you can achieve the required in the dropDownOpening event:
dropDownOpening: function (evt, ui) { if (ui.owner.selectedItems()) { var selectedNode = ui.owner.selectedItems()[0].element[0].cloneNode(true); ui.owner.selectedItems()[0].element[0].remove(); var listHolder = ui.owner.dropDown().find(".ui-igcombo-listitemholder")[0]; listHolder.insertBefore(selectedNode, listHolder.firstElementChild); } }
Please review the jsfiddle to see this working and let me know if you have more questions.
Thanks for your reply, but I think this might actually just *move* the selected item rather than scroll it to the top of the drop down. Sorry if my original question wasn't clear.