mskocik / svelecte

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

Make $selected non enumerable #232

Closed jamesst20 closed 3 months ago

jamesst20 commented 3 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 3 months ago

This seems to be still broken as mentioned in #233