elastic / search-ui

Search UI. Libraries for the fast development of modern, engaging search experiences.
https://docs.elastic.co/search-ui
Apache License 2.0
1.92k stars 368 forks source link

Wrong type definition inside `FacetViewProps` #979

Closed wentaoxu415 closed 1 year ago

wentaoxu415 commented 1 year ago

Describe the bug In the FacetViewProps type, the parameters for the callback functions (onRemove, onChange, onSelect) are typed as FieldValue. https://github.com/elastic/search-ui/blob/main/packages/react-search-ui-views/src/types/index.ts#L68

However, those callback functions eventually call search driver actions for filters and the expected type there is FilterValue instead of FieldValue. (Ex. See removeFilters

To Reproduce See the linked code files.

Expected behavior The type definition for the parameters passed to those callback functions in the FacetViewProps should be updated to FilterValue type.

Screenshots N/A

Which backends and packages are you using: Packages: search-ui 1.20.0

joemcelroy commented 1 year ago

thank you. Happy to accept a PR for this change!

wentaoxu415 commented 1 year ago

Awesome! Will send you a PR for this soon :)

botelastic[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Is this issue still important to you? If so, please leave a comment and let us know. As always, thank you for your contributions.