<commit_before>var radioButtonsViewBridge = function (leafPath) {
    window.rhubarb.viewBridgeClasses.SelectionControlViewBridge.apply(this, arguments);

    this.supportsMultipleSelection = false;
};

radioButtonsViewBridge.prototype = new window.rhubarb.viewBridgeClasses.SelectionControlViewBridge();
radioButtonsViewBridge.prototype.constructor = radioButtonsViewBridge;

radioButtonsViewBridge.prototype.setValue = function (value) {
    this.selectAndIterateElements('input[type=radio]', function(item) {
        if (item.value == value) {
            item.checked = true;
        }
    });

    this.model.SelectedItems = [{"value": value}];

    this.valueChanged();
};

radioButtonsViewBridge.prototype.valueChanged = function () {
    var checkedInput = this.viewNode.querySelector("input:checked");

    if (checkedInput) {
        this.model.SelectedItems = [{"value": checked.length ? checked.value : null}];
    } else {
        this.model.SelectedItems = [];
    }

    // Calling our parent will ensure the new value gets raised as an event
    window.rhubarb.viewBridgeClasses.SelectionControlViewBridge.prototype.valueChanged.apply(this, arguments);
};

window.rhubarb.viewBridgeClasses.RadioButtonsViewBridge = radioButtonsViewBridge;
<commit_msg>Fixing issue with Radio Buttons Checked Value not being set correctly<commit_after>var radioButtonsViewBridge = function (leafPath) {
    window.rhubarb.viewBridgeClasses.SelectionControlViewBridge.apply(this, arguments);

    this.supportsMultipleSelection = false;
};

radioButtonsViewBridge.prototype = new window.rhubarb.viewBridgeClasses.SelectionControlViewBridge();
radioButtonsViewBridge.prototype.constructor = radioButtonsViewBridge;

radioButtonsViewBridge.prototype.setValue = function (value) {
    this.selectAndIterateElements('input[type=radio]', function(item) {
        if (item.value == value) {
            item.checked = true;
        }
    });

    this.model.SelectedItems = [{"value": value}];

    this.valueChanged();
};

radioButtonsViewBridge.prototype.valueChanged = function () {
    var checkedInput = this.viewNode.querySelector("input:checked");

    if (checkedInput) {
        this.model.SelectedItems = [{"value": checkedInput.length ? checkedInput[0].value : null}];
    } else {
        this.model.SelectedItems = [];
    }

    // Calling our parent will ensure the new value gets raised as an event
    window.rhubarb.viewBridgeClasses.SelectionControlViewBridge.prototype.valueChanged.apply(this, arguments);
};

window.rhubarb.viewBridgeClasses.RadioButtonsViewBridge = radioButtonsViewBridge;

{'fraction_non_alphanumeric': 0.10833653476757588, 'fraction_numerical': 0.000384172109104879, 'mean_word_length': 4.505285412262157, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3107277', 'n_tokens_mistral': 730, 'n_tokens_neox': 709, 'n_words': 126}