Skip to content

Commit

Permalink
Always show active value in ActiveFilters
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Feb 3, 2023
1 parent f894eb2 commit da17feb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
11 changes: 6 additions & 5 deletions searchlib/components/Facets/ActiveFilters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const ActiveFilters = (props) => {
const initialValue =
(filters.find((f) => f.field === field) || {})?.values || [];

const [activeFilter, setActiveFilter] = React.useState(initialValue);
const activeFilter = initialValue;
// const [activeFilter, setActiveFilter] = React.useState(initialValue);

return activeFilter.length > 0 ? (
<div className="active-filters">
Expand All @@ -30,10 +31,10 @@ const ActiveFilters = (props) => {
className="clear-filters"
size="mini"
onClick={() => {
let filteredValues = activeFilter.filter(
(v) => v !== option,
);
setActiveFilter(filteredValues);
// let filteredValues = activeFilter.filter(
// (v) => v !== option,
// );
// // setActiveFilter(filteredValues);
onRemove(option);
}}
>
Expand Down
4 changes: 1 addition & 3 deletions searchlib/components/Facets/StickyFacetList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const SmallScreenFacets = () => {
return (
<div>
<Dimmer active={active} verticalAlign="top" page className="facet-dimmer">
{active ? (
{active && (
<>
<ErrorBoundary>
<MoreLikeThis />
Expand All @@ -36,8 +36,6 @@ const SmallScreenFacets = () => {
)}
/>
</>
) : (
''
)}

<Button.Group>
Expand Down
1 change: 1 addition & 0 deletions searchlib/lib/hocs/useWhyDidYouUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default function useWhyDidYouUpdate(name, props) {
});
// If changesObj not empty then output to console
if (Object.keys(changesObj).length) {
// eslint-disable-next-line no-console
console.log('[why-did-you-update]', name, changesObj);
}
}
Expand Down

0 comments on commit da17feb

Please sign in to comment.