src/components/ebay-menu/index.js
function setCheckedItem(itemIndex, toggle) {
    const item = this.state.items[itemIndex];

    if (item) {
        if (this.state.isCheckbox && !toggle) {
            item.checked = true;
        } else if (this.state.isCheckbox && toggle) {
            item.checked = !item.checked;
        } else if (this.state.isRadio) {
            this.state.items[itemIndex].checked = true;
        }

        if (this.state.isCheckbox || this.state.isRadio) {
            this.setStateDirty('items');
        }

        if (this.state.isRadio || toggle) {
            this.processAfterStateChange([itemIndex]);
        }
    }
}
function setCheckedItem(itemIndex, toggle) {
    const item = this.state.items[itemIndex];

    if (item) {
        if (this.state.isCheckbox && !toggle) {
            item.checked = true;
        } else if (this.state.isCheckbox && toggle) {
            item.checked = !item.checked;
        } else if (this.state.isRadio) {
            this.state.items[itemIndex].checked = true;
        }

        if (this.state.isCheckbox || this.state.isRadio) {
            this.setStateDirty('items');
        }

        if (this.state.isRadio || toggle) {
            this.processAfterStateChange([itemIndex]);
        }
    }
}
function setCheckedItem ( itemIndex , toggle ) { const item = this . state . items [ itemIndex ] ; if ( item ) { if ( this . state . isCheckbox && ! toggle ) { item . checked = true ; } else if ( this . state . isCheckbox && toggle ) { item . checked = ! item . checked ; } else if ( this . state . isRadio ) { this . state . items [ itemIndex ] . checked = true ; } if ( this . state . isCheckbox || this . state . isRadio ) { this . setStateDirty ( 'items' ) ; } if ( this . state . isRadio || toggle ) { this . processAfterStateChange ( [ itemIndex ] ) ; } } }
Set the checked item based on the index
@param {Integer} itemIndex
@param {Boolean} toggle
Set the checked item based on the index