Skip to content

Commit

Permalink
Merge pull request #246 from adobecom/MWPW-157306
Browse files Browse the repository at this point in the history
feat(mwpw-157306): search closes after search is executed even with query present in search
  • Loading branch information
sheridansunier authored Feb 12, 2025
2 parents efb7266 + 9a8787f commit 3fbd320
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dist/app.css

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions dist/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Chimera UI Libraries - Build 0.29.5 (2/11/2025, 13:26:50)
* Chimera UI Libraries - Build 0.29.7 (2/12/2025, 09:45:39)
*
*/
/******/ (function(modules) { // webpackBootstrap
Expand Down Expand Up @@ -7980,6 +7980,7 @@ var Container = function Container(props) {
isTopFilterPanel && isStandardContainer && _react2.default.createElement(_Panel2.default, {
filterPanelEnabled: filterPanelEnabled,
filters: filters,
searchQuery: searchQuery,
windowWidth: windowWidth,
resQty: gridCardLen,
onCheckboxClick: handleCheckBoxChange,
Expand Down Expand Up @@ -53168,8 +53169,8 @@ var Paginator = function Paginator(props) {
}
var caasWrapper = target.closest('.consonant-Wrapper') || target.closest('section');
if (caasWrapper && caasWrapper.getBoundingClientRect().y < 0) {
var caasWrapperTop = caasWrapper.getBoundingClientRect().top + window.scrollY - globalNavHeight;
window.scrollTo({ left: 0, top: caasWrapperTop, behavior: 'smooth' });
var scrollTargetPosition = caasWrapper.getBoundingClientRect().top + window.scrollY - globalNavHeight;
window.scrollTo({ left: 0, top: scrollTargetPosition, behavior: 'smooth' });
}
onClick(nextPage);
};
Expand Down Expand Up @@ -53595,6 +53596,7 @@ var filtersPanelTopType = {
onFilterClick: _propTypes.func.isRequired,
onShowAllClick: _propTypes.func.isRequired,
searchComponent: _propTypes.node.isRequired,
searchQuery: _propTypes.string,
filters: (0, _propTypes.arrayOf)((0, _propTypes.shape)(_config.filterType)),
onCheckboxClick: _propTypes.func.isRequired,
onClearAllFilters: _propTypes.func.isRequired,
Expand All @@ -53605,6 +53607,7 @@ var filtersPanelTopType = {
var defaultProps = {
resQty: 0,
filters: [],
searchQuery: '',
showLimitedFiltersQty: false
};

Expand Down Expand Up @@ -53642,6 +53645,7 @@ var FiltersPanelTop = function FiltersPanelTop(props) {
onShowAllClick = props.onShowAllClick,
windowWidth = props.windowWidth,
searchComponent = props.searchComponent,
searchQuery = props.searchQuery,
sortComponent = props.sortComponent,
filterPanelEnabled = props.filterPanelEnabled;

Expand Down Expand Up @@ -53801,7 +53805,7 @@ var FiltersPanelTop = function FiltersPanelTop(props) {
* Whether the search bar should be visible
* @type {Boolean}
*/
var shouldShowSearchBar = openExpandable === searchId;
var shouldShowSearchBar = searchQuery.length || openExpandable === searchId;

var shouldRenderInnerWrapper = shouldDisplayFilters || searchEnabled || shouldDisplaySortComponent || shouldDisplayCollectionInfo;

Expand Down
6 changes: 3 additions & 3 deletions dist/main.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/main.source.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions react/src/js/components/Consonant/Container/Container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,7 @@ const Container = (props) => {
<FiltersPanelTop
filterPanelEnabled={filterPanelEnabled}
filters={filters}
searchQuery={searchQuery}
windowWidth={windowWidth}
resQty={gridCardLen}
onCheckboxClick={handleCheckBoxChange}
Expand Down
6 changes: 5 additions & 1 deletion react/src/js/components/Consonant/Filters/Top/Panel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
bool,
func,
node,
string,
} from 'prop-types';

import { filterType } from '../../types/config';
Expand Down Expand Up @@ -36,6 +37,7 @@ const filtersPanelTopType = {
onFilterClick: func.isRequired,
onShowAllClick: func.isRequired,
searchComponent: node.isRequired,
searchQuery: string,
filters: arrayOf(shape(filterType)),
onCheckboxClick: func.isRequired,
onClearAllFilters: func.isRequired,
Expand All @@ -46,6 +48,7 @@ const filtersPanelTopType = {
const defaultProps = {
resQty: 0,
filters: [],
searchQuery: '',
showLimitedFiltersQty: false,
};

Expand Down Expand Up @@ -84,6 +87,7 @@ const FiltersPanelTop = (props) => {
onShowAllClick,
windowWidth,
searchComponent,
searchQuery,
sortComponent,
filterPanelEnabled,
} = props;
Expand Down Expand Up @@ -240,7 +244,7 @@ const FiltersPanelTop = (props) => {
* Whether the search bar should be visible
* @type {Boolean}
*/
const shouldShowSearchBar = openExpandable === searchId;
const shouldShowSearchBar = searchQuery.length || (openExpandable === searchId);

const shouldRenderInnerWrapper = shouldDisplayFilters
|| searchEnabled || shouldDisplaySortComponent || shouldDisplayCollectionInfo;
Expand Down

0 comments on commit 3fbd320

Please sign in to comment.