szn-options.js
function onItemSelectionStart(instance, itemUi, event) {
    if (instance._options.disabled || !instance._options.multiple || !isEnabledOptionUi(itemUi)) {
      return
    }

    const options = instance._options.options
    if (event.shiftKey && instance._previousSelectionStartIndex > -1) {
      instance._dragSelectionStartOption = options.item(instance._previousSelectionStartIndex)
    } else {
      if (event.ctrlKey) {
        instance._additionalSelectedIndexes = []
        for (let i = 0, length = options.length; i < length; i++) {
          if (options.item(i).selected) {
            instance._additionalSelectedIndexes.push(i)
          }
        }
        instance._invertSelection = itemUi._option.selected
      } else {
        instance._invertSelection = false
      }
      instance._dragSelectionStartOption = itemUi._option
    }
    instance._previousSelectionStartIndex = instance._dragSelectionStartOption.index
    updateMultiSelection(instance, itemUi)
  }
function onItemSelectionStart(instance, itemUi, event) {
    if (instance._options.disabled || !instance._options.multiple || !isEnabledOptionUi(itemUi)) {
      return
    }

    const options = instance._options.options
    if (event.shiftKey && instance._previousSelectionStartIndex > -1) {
      instance._dragSelectionStartOption = options.item(instance._previousSelectionStartIndex)
    } else {
      if (event.ctrlKey) {
        instance._additionalSelectedIndexes = []
        for (let i = 0, length = options.length; i < length; i++) {
          if (options.item(i).selected) {
            instance._additionalSelectedIndexes.push(i)
          }
        }
        instance._invertSelection = itemUi._option.selected
      } else {
        instance._invertSelection = false
      }
      instance._dragSelectionStartOption = itemUi._option
    }
    instance._previousSelectionStartIndex = instance._dragSelectionStartOption.index
    updateMultiSelection(instance, itemUi)
  }
function onItemSelectionStart ( instance , itemUi , event ) { if ( instance . _options . disabled || ! instance . _options . multiple || ! isEnabledOptionUi ( itemUi ) ) { return } const options = instance . _options . options if ( event . shiftKey && instance . _previousSelectionStartIndex > - 1 ) { instance . _dragSelectionStartOption = options . item ( instance . _previousSelectionStartIndex ) } else { if ( event . ctrlKey ) { instance . _additionalSelectedIndexes = [ ] for ( let i = 0 , length = options . length ; i < length ; i ++ ) { if ( options . item ( i ) . selected ) { instance . _additionalSelectedIndexes . push ( i ) } } instance . _invertSelection = itemUi . _option . selected } else { instance . _invertSelection = false } instance . _dragSelectionStartOption = itemUi . _option } instance . _previousSelectionStartIndex = instance . _dragSelectionStartOption . index updateMultiSelection ( instance , itemUi ) }
Handles start of the user dragging the mouse pointer over the UI of a multi-selection szn-options element. The
function marks the starting item.

The function marks the starting item used previously as the current starting item if the Shift key is pressed. The
function marks the indexes of the currently selected items if the Ctrl key is pressed and the Shift key is not.
Also, if the Ctrl key pressed, the Shift key is not, and the user starts at an already selected item, the function
will mark this as inverted selection.

The function has no effect for single-selects.

@param {SznElements.SznOptions} instance The szn-options element instance.
@param {Element} itemUi The element at which the user pressed the primary mouse button down.
@param {MouseEvent} event The mouse event representing the user's action.
Handles start of the user dragging the mouse pointer over the UI of a multi - selection szn - options element . The function marks the starting item .