mskocik / svelecte

Flexible autocomplete/select component written in Svelte,
https://svelecte.vercel.app
MIT License
471 stars 43 forks source link

Make $selected non enumerable #232

Closed jamesst20 closed 5 months ago

jamesst20 commented 5 months ago

Hi,

When I use valueAsObject={true} I end up having $selected: true in my payload.

This could be fixed by marking the property as non enumerable.

if (!Object.prototype.hasOwnProperty.call(item, "$selected")) {
  Object.defineProperty(item, "$selected", { enumerable: false, writable: true });
}

Could this be done? :)

v5.0.0-next.6

mskocik commented 5 months ago

This seems to be still broken as mentioned in #233