You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (this.item.hasOwnProperty(this.vscrollData.keyField)) returnthis.item[this.vscrollData.keyField]
Cause:
This is happening because the check for the existence of the keyField in the item uses hasOwnProperty which only looks at the Object's own properties and not all the way down the prototype chain.
Proposed solution: if ( this.vscrollData.keyField in this.item ) return this.item[this.vscrollData.keyField]
in checks the object's own and inherited properties.
Describe the bug
Error from DynamicScrollerItem.vue:
keyField 'id' not found in your item. You should set a valid keyField prop on your Scroller
vue-virtual-scroller/packages/vue-virtual-scroller/src/components/DynamicScrollerItem.vue
Line 55 in 1c76ec6
Cause:
This is happening because the check for the existence of the
keyField
in the item useshasOwnProperty
which only looks at the Object's own properties and not all the way down the prototype chain.Proposed solution:
if ( this.vscrollData.keyField in this.item ) return this.item[this.vscrollData.keyField]
in
checks the object's own and inherited properties.This was a breaking change since v1.0.10
Reproduction
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: