src/dual-listbox.js
/**
     * Action when single clicked on a listItem.
     */
Action when single clicked on a listItem.
Action when single clicked on a listItem .
_actionItemClick(listItem, dualListbox, event = null) {
        if (event) {
            event.preventDefault();
        }
        let items = dualListbox.querySelectorAll(`.${ITEM_ELEMENT}`);
        for (let i = 0; i < items.length; i++) {
            let value = items[i];
            if (value !== listItem) {
                value.classList.remove(SELECTED_MODIFIER);
            }
        }
        if (listItem.classList.contains(SELECTED_MODIFIER)) {
            listItem.classList.remove(SELECTED_MODIFIER);
        } else {
            listItem.classList.add(SELECTED_MODIFIER);
        }
    }
_actionItemClick ( listItem , dualListbox , event = null ) { if ( event ) { event . preventDefault ( ) ; } let items = dualListbox . querySelectorAll ( ` ${ ITEM_ELEMENT } ` ) ; for ( let i = 0 ; i < items . length ; i ++ ) { let value = items [ i ] ; if ( value !== listItem ) { value . classList . remove ( SELECTED_MODIFIER ) ; } } if ( listItem . classList . contains ( SELECTED_MODIFIER ) ) { listItem . classList . remove ( SELECTED_MODIFIER ) ; } else { listItem . classList . add ( SELECTED_MODIFIER ) ; } }
Action when single clicked on a listItem.
Action when single clicked on a listItem .