[SalesForce] Add onchange event for lightning:inputField in $A.createComponents

I am trying to create a lightning:inputField using $A.createComponents. The issue I have is that I am not able to add an onchange event. The field Level__c is a picklist field.

When I use the following code in the component the onchange event works fine:

<lightning:inputField fieldName="Level__c" onchange="{!c.reload}"/>

However, when I use the following code within $A.createComponents I get an error message ,Cannot read property 'indexOf' of undefined'.

Component

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<aura:attribute name="contract" type="Contract__c" default="{ 'sobjectType': 'Contract__c' }" access="public"/>
 <aura:handler name="init" value="{!this}" action="{!c.init}" /> 
<lightning:recordEditForm recordId="{!v.recordId}" objectApiName="Contract__c">
    {!v.body}
</lightning:recordEditForm>

Controller

({
init: function(cmp, event, helper){
    helper.createComponents(cmp);   

},

reload: function(cmp, event, helper){
    helper.createComponents(cmp);        
}})

Helper

({
createComponents: function(cmp){        
    console.log(cmp.getReference("c.reload"));
    $A.createComponent("lightning:inputField", {"fieldName"  : "Level__c", "aura:id": "Level__c", "onchange":cmp.getReference("c.reload")},
    function(newCmp, status, errorMessage){
        if (status === "SUCCESS") {
            var body = cmp.get("v.body");                
            body.push(newCmp);
            cmp.set("v.body", body);
        }            
        else if (status === "INCOMPLETE") {
            console.log("No response from server or client is offline.")
        }
        else if (status === "ERROR") {
            console.log("Error: " + errorMessage);
        }
    });  
},})

Best Answer

I found a workaround. I just put the onchange event on the parent div as shown below. However, it would be nice to be able to assign it directly to lightning:inputField. I assume there is a bug in the code.

var changeOrderType = component.getReference("c.changeOrderType");
    newComponents.push(["aura:html", {"tag": "div", "HTMLAttributes": {"class": "slds-form-element__control", "onchange": changeOrderType}}]);      
    newComponents.push(["lightning:inputField", {"fieldName"  : "Contract_type__c", "aura:id": "input_contract_type__c", "value": contract.Contract_type__c}]);