szn-options.js
function onItemClicked(instance, itemUi) {
    if (instance._dragSelectionStartOption) { // multi-select
      instance._dragSelectionStartOption = null
      return
    }

    if (instance._options.disabled || !isEnabledOptionUi(itemUi)) {
      return
    }

    instance._root.removeAttribute('data-szn-options--highlighting')
    instance._options.selectedIndex = itemUi._option.index
    instance._options.dispatchEvent(new CustomEvent('change', {bubbles: true, cancelable: true}))
  }
function onItemClicked(instance, itemUi) {
    if (instance._dragSelectionStartOption) { // multi-select
      instance._dragSelectionStartOption = null
      return
    }

    if (instance._options.disabled || !isEnabledOptionUi(itemUi)) {
      return
    }

    instance._root.removeAttribute('data-szn-options--highlighting')
    instance._options.selectedIndex = itemUi._option.index
    instance._options.dispatchEvent(new CustomEvent('change', {bubbles: true, cancelable: true}))
  }
function onItemClicked ( instance , itemUi ) { if ( instance . _dragSelectionStartOption ) { // multi-select instance . _dragSelectionStartOption = null return } if ( instance . _options . disabled || ! isEnabledOptionUi ( itemUi ) ) { return } instance . _root . removeAttribute ( 'data-szn-options--highlighting' ) instance . _options . selectedIndex = itemUi . _option . index instance . _options . dispatchEvent ( new CustomEvent ( 'change' , { bubbles : true , cancelable : true } ) ) }
Handles the user releasing the primary mouse button over an element representing an item.

The function ends multiple-items selection for multi-selects, ends options highlighting and marks the the selected
option for single-selects.

@param {SznElements.SznOptions} instance The szn-options element instance.
@param {Element} itemUi The element at which the user released the primary mouse button.
Handles the user releasing the primary mouse button over an element representing an item .