Does not filter/search by label
I notice when I use a label the filter does not work as expected and only filters based on the key.
For example: https://codesandbox.io/s/leva-3d-9i4h8
- Key:
repeat - Label:
text. repeat
const { ... } = useControls({
shape: folder({
//...
repeat: { value: [12, 3], label: 'text. repeat', joystick: false },
//...
})
})
| Before filtering | ✅ Filtering Key | :x: Filtering Label |
|---|---|---|
![]() |
![]() |
![]() |
Solution
I think the applicable code is here: https://github.com/pmndrs/leva/blob/25747f423a8884f17c6fb4537cbfa53a3f87e100/packages/leva/src/components/Leva/tree.ts#L13
Used from here: https://github.com/pmndrs/leva/blob/25747f423a8884f17c6fb4537cbfa53a3f87e100/packages/leva/src/components/Leva/LevaRoot.tsx#L138
If this is not expected behaviour and others would also like fixed then I'd be happy to try to submit a PR 😃 Let me know!
You're totally right. Shouldn't be a big deal to fix in theory this but since label is in the settings you would need to fetch the settings for a given path and that might not be trivial to do this in that part of the code. You can have a shot at this if you feel like it, but another option would be to pass the filter as a context value and do the filter at the input level.


