JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › ComboBox › assigning hidden values to combo box elements › Reply To: assigning hidden values to combo box elements
i believe you mean itemClick…..? (not itemClicked) i have already found that and have incorporated it into my working example:
https://codepen.io/edwardsmarkf/pen/BaNBwBX
as you can see, its pretty straightforward:
——
let thisIndex = document.querySelector(‘smart-combo-box’).selectedIndexes.length – 1;
let thisItem = document.getElementsByClassName(‘smart-drop-down-list-selection-label’)[thisIndex] ;
thisItem.addEventListener(‘click’, function() { comboItemClicked(value); } , false) ;
——–
since the combo box always puts the most recently selected item in the last place, length -1 lets us know the last position.