1

I have a lightning component and I'm using lightning:pill to show selected ids. Whenever I call the onitemremove I get this error

[Cannot read property '$$OwnerKey$$' of null]

I've managed to pinpoint that using the splice function causes the error. I'm also using jQuery 224.

HTML

<lightning:pillContainer aura:id="pillContainer" items="{!v.selectedProductIds}" onitemremove="{!c.removeItem}"/>

Controller.js

removeItem : function(component, event, helper){
    helper.removeItem(component, event);
},

Helper.js

removeItem : function(component, event){
    var index = event.getParam("index");
    var items = component.get('v.selectedProductIds');

    items.splice(index, 1);
    component.set('v.selectedProductIds', items);   

},
2

1 Answer 1

0

There's a known issue in the Winter '19 release that hasn't been resolved yet. It's related to inputfields though. I wouldn't have thought of pillcontainer as in input! Seems like a very specific error message though. Take a look:

Lightning input fields throw error: Cannot read property '$$OwnerKey$$' of null

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.