You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the SelectMultiple component for filtering results purposes, I'm calling the Search bar with onSearch prop.
I'm facing a problem when I type in a search and have shown one wanted result, select it, component refreshes, and all results appear back, but the search string still remains in the search bar.
Is there a way to change that behavior, I would expect that search string to be cleared since all the results appeared back.
For the summary:
We must refresh the values inside the SelectMultiple component after each selection because the rest of the data in the results and the values in the other filters are being filtered depending on the selected field inside the SelectMultiple.
Actual Behavior:
For example, if we have a filter named ''Categories" which has listed "Document", "Forums" and "Videos" values that can be selected in order to filter results, and if I type in the search label "Document" and have returned and selected it, the list of these values is listed again like so "Category", "Document", "Forums" and in search label the input remained search input "Document" which does not make so much sense to me.
Hi everyone,
I'm using the SelectMultiple component for filtering results purposes, I'm calling the Search bar with onSearch prop.
I'm facing a problem when I type in a search and have shown one wanted result, select it, component refreshes, and all results appear back, but the search string still remains in the search bar.
Is there a way to change that behavior, I would expect that search string to be cleared since all the results appeared back.
For the summary:
We must refresh the values inside the SelectMultiple component after each selection because the rest of the data in the results and the values in the other filters are being filtered depending on the selected field inside the SelectMultiple.
Actual Behavior:
For example, if we have a filter named ''Categories" which has listed "Document", "Forums" and "Videos" values that can be selected in order to filter results, and if I type in the search label "Document" and have returned and selected it, the list of these values is listed again like so "Category", "Document", "Forums" and in search label the input remained search input "Document" which does not make so much sense to me.
`const Facet = ({ controller, title, enableSearch }) => {
const { t } = useTranslation(['support_hub_search', 'location'])
const [options, setOptions] = useState(
controller.state.values.map((value) => value.value)
)
useEffect(() => {
const unsubscribe = controller.subscribe(() => {
setOptions(controller.state.values.map((value) => value.value))
})
}, [controller])
if (
!controller.state.values.filter(
(value) => value.state !== 'idle' || value.numberOfResults > 0
).length
) {
return null
}
const handleFacetValuesChange = (nextValues) => {
const valuesToDeselect = []
const valuesToSelect = []
}
return (
<FormField
htmlFor={
facetCheckbox-${title}
}label={t(title)}
data-testid={title}
>
<SelectMultiple
id={
${title}
}name={
facetCheckbox-${title}
}placeholder={t('location:select')}
searchPlaceholder={t('support_hub_search:facet_search_placeholder')}
data-testid="facet-checkbox"
dropHeight="medium"
labelKey={(option) => {
const valueObject = controller.state.values.find(
(val) => val.value === option
)
const translationKey = valueObject
?
${controller.state.facetId}.${valueObject.value}
:
${controller.state.facetId}.${option}
)
}`
CC: @taysea
The text was updated successfully, but these errors were encountered: