src/dual-listbox.js
/**
     * Action to set all listItems to available.
     */
Action to set all listItems to available.
Action to set all listItems to available .
_actionAllDeselected(event) {
        event.preventDefault();
        let deselected = this.selected.filter(
            (item) => item.style.display !== "none"
        );
        deselected.forEach(function (listItem) {
            let index = this.selected.indexOf(listItem);
            if (index > -1) {
                this.selected.splice(index, 1);
                this.available.push(listItem);
                this._deselectOption(listItem.dataset.id);
                setTimeout(() => {
                    let event = document.createEvent("HTMLEvents");
                    event.initEvent("removed", false, true);
                    event.removedElement = listItem;
                    this.dualListbox.dispatchEvent(event);
                }, 0);
            }
        });
        this.redraw();
    }
_actionAllDeselected ( event ) { event . preventDefault ( ) ; let deselected = this . selected . filter ( ( item ) => item . style . display !== "none" ) ; deselected . forEach ( function ( listItem ) { let index = this . selected . indexOf ( listItem ) ; if ( index > - 1 ) { this . selected . splice ( index , 1 ) ; this . available . push ( listItem ) ; this . _deselectOption ( listItem . dataset . id ) ; setTimeout ( ( ) => { let event = document . createEvent ( "HTMLEvents" ) ; event . initEvent ( "removed" , false , true ) ; event . removedElement = listItem ; this . dualListbox . dispatchEvent ( event ) ; } , 0 ) ; } } ) ; this . redraw ( ) ; }
Action to set all listItems to available.
Action to set all listItems to available .