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
https://github.com/Akryum/vue-virtual-scroller/blob/1c76ec6dccbea7d602d38a0c8e795dc8ce5f36af/packages/vue-virtual-scroller/src/components/DynamicScrollerItem.vue#L55
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