svelecte icon indicating copy to clipboard operation
svelecte copied to clipboard

Search does not work for nested properties

Open peakercope opened this issue 8 months ago • 1 comments

To reproduce:

  1. Open https://stackblitz.com/edit/vitejs-vite-avofes?file=src%2FApp.svelte&terminal=dev or use next template:
<script>
  import Svelecte from 'svelecte/src/Svelecte.svelte'

  let value = ''

  const options = [
    {
      value: 1,
      label: 'Label',
      name: { value: "Chrome" }
    },
    {
      value: 2,
      label: "Second",
      name: { value: "Firefox" }
    }
  ]
</script>

  <Svelecte
    inputId="test"
    searchable
    {options}
    bind:value 
    searchField={['value', 'label', 'name.value']}
  />
  1. Try to type any value from name.value property (e.g. "chrome") into autocomplete

Actual result: "No matching options" message appeared

Expected result: The appropriate option must be found

peakercope avatar Oct 27 '23 12:10 peakercope

Nesting is disabled for better performance and there is no setting enabling it.

mskocik avatar Oct 30 '23 14:10 mskocik