Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: cleanup autoHideContainer related options
  • Loading branch information
Alex S committed Sep 17, 2018
commit d8c20d42c07fd632a7ea44186e0c066810e934a1
3 changes: 0 additions & 3 deletions dev/app/builtin/stories/clear-refinements.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default () => {
window.search.addWidget(
instantsearch.widgets.clearRefinements({
container,
autoHideContainer: false,
})
);
},
Expand All @@ -33,7 +32,6 @@ export default () => {
window.search.addWidget(
instantsearch.widgets.clearRefinements({
container,
autoHideContainer: false,
})
);
})
Expand All @@ -45,7 +43,6 @@ export default () => {
window.search.addWidget(
instantsearch.widgets.clearRefinements({
container,
autoHideContainer: false,
clearsQuery: true,
templates: {
link: 'Clear refinements and query',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ exports[`clearRefinements() with refinements calls twice ReactDOM.render(<ClearA
}
hasRefinements={true}
refine={[Function]}
shouldAutoHideContainer={false}
templateProps={
Object {
"templates": Object {
Expand Down Expand Up @@ -40,7 +39,6 @@ exports[`clearRefinements() with refinements calls twice ReactDOM.render(<ClearA
}
hasRefinements={true}
refine={[Function]}
shouldAutoHideContainer={false}
templateProps={
Object {
"templates": Object {
Expand Down Expand Up @@ -68,7 +66,6 @@ exports[`clearRefinements() without refinements calls twice ReactDOM.render(<Cle
}
hasRefinements={false}
refine={[Function]}
shouldAutoHideContainer={true}
templateProps={
Object {
"templates": Object {
Expand Down Expand Up @@ -96,7 +93,6 @@ exports[`clearRefinements() without refinements calls twice ReactDOM.render(<Cle
}
hasRefinements={false}
refine={[Function]}
shouldAutoHideContainer={true}
templateProps={
Object {
"templates": Object {
Expand Down
7 changes: 0 additions & 7 deletions src/widgets/clear-refinements/clear-refinements.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const renderer = ({
containerNode,
cssClasses,
collapsible,
autoHideContainer,
renderState,
templates,
}) => ({ refine, hasRefinements, instantSearchInstance }, isFirstRendering) => {
Expand All @@ -29,15 +28,12 @@ const renderer = ({
return;
}

const shouldAutoHideContainer = autoHideContainer && !hasRefinements;

render(
<ClearRefinements
refine={refine}
collapsible={collapsible}
cssClasses={cssClasses}
hasRefinements={hasRefinements}
shouldAutoHideContainer={shouldAutoHideContainer}
templateProps={renderState.templateProps}
/>,
containerNode
Expand All @@ -49,7 +45,6 @@ clearRefinements({
container,
[ cssClasses.{root,button,disabledButton}={} ],
[ templates.{resetLabel}={resetLabel: 'Clear all refinements'} ],
[ autoHideContainer=true ],
[ collapsible=false ],
[ excludedAttributes=[] ]
})`;
Expand Down Expand Up @@ -100,7 +95,6 @@ export default function clearRefinements({
templates = defaultTemplates,
cssClasses: userCssClasses = {},
collapsible = false,
autoHideContainer = true,
excludedAttributes = [],
clearsQuery = false,
}) {
Expand All @@ -123,7 +117,6 @@ export default function clearRefinements({
containerNode,
cssClasses,
collapsible,
autoHideContainer,
renderState: {},
templates,
});
Expand Down