Skip to content

Commit

Permalink
disable facets while the results are loading
Browse files Browse the repository at this point in the history
  • Loading branch information
zotya committed Dec 13, 2023
1 parent 3994c03 commit 6529042
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import { openFacetsAtom } from '../state';
import { useSetAtom } from 'jotai';
import { useAppConfig, useSearchContext } from '@eeacms/search/lib/hocs';
import Facet from '../Facet';
import { Dimmer } from 'semantic-ui-react';

const AccordionFacetWrapper = (props) => {
const { collapsable = true, field, label } = props;
const { collapsable = true, field, label, isLoading } = props;
const searchContext = useSearchContext();
const { filters } = searchContext;

Expand Down Expand Up @@ -79,6 +80,7 @@ const AccordionFacetWrapper = (props) => {
<Icon className="ri-arrow-down-s-line" />
</Accordion.Title>
<Accordion.Content active={isOpened}>
{isLoading && <Dimmer active></Dimmer>}
<Facet
{...props}
active={isOpened}
Expand Down
3 changes: 3 additions & 0 deletions searchlib/components/Facets/Wrappers/DropdownFacetWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const DropdownFacetWrapper = (props) => {
removeFilter,
sortedOptions,
filterType,
isLoading,
} = props;
const rawSearchContext = useSearchContext();
const {
Expand Down Expand Up @@ -94,6 +95,7 @@ const DropdownFacetWrapper = (props) => {
</Modal.Header>
<Modal.Content>
<SearchContext.Provider value={facetSearchContext}>
{isLoading && <Dimmer active></Dimmer>}
<SUIFacet
{...props}
active={isOpen}
Expand Down Expand Up @@ -169,6 +171,7 @@ const DropdownFacetWrapper = (props) => {
}
}}
>
{isLoading && <Dimmer active></Dimmer>}
<SUIFacet
{...props}
active={isOpen}
Expand Down
4 changes: 4 additions & 0 deletions src/SearchBlock/less/dropdown-filterlist.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

.searchlib-block {
.ui.dimmer.facet-dimmer {
position: fixed;
Expand Down Expand Up @@ -147,6 +148,9 @@
.title i:before {
font-size: 2rem;
}
.content.active {
position:relative !important;
}
}
}
}
Expand Down

0 comments on commit 6529042

Please sign in to comment.