Skip to content

Commit

Permalink
Themes 1578 and 1551- Search Input Behavior (#1851)
Browse files Browse the repository at this point in the history
* Fixed search input bug

* fixed search bug on mobile

* removed closeDrawer function and references
  • Loading branch information
blakeganderson authored Dec 14, 2023
1 parent cdd8f76 commit 8a5274c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default ({ alwaysOpen = false, placeholderText, customSearchAction = null
}
}, [shouldSearchOpen]);

const handleSearchBtnMousedown = (event) => {
const handleSearchBtnMouseUp = (event) => {
if (!isSearchBarPending) {
// if open, prevent blur event so we don't get a race condition on click vs blur
if (shouldSearchOpen) {
Expand Down Expand Up @@ -75,7 +75,7 @@ export default ({ alwaysOpen = false, placeholderText, customSearchAction = null
variant="secondary-reverse"
size="small"
onClick={handleClick}
onMouseDown={handleSearchBtnMousedown}
onMouseUp={handleSearchBtnMouseUp}
type="button"
>
<Icon name="Search" width={24} height={24} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export function PresentationalNav(props) {
const {
ariaLabelLink,
children,
closeDrawer,
customFields,
displayLinks,
horizontalLinksHierarchy,
Expand Down Expand Up @@ -103,7 +102,6 @@ export function PresentationalNav(props) {
}`}
direction="vertical"
justification="start"
onClick={closeDrawer}
>
<FocusTrap
active={isSectionDrawerOpen}
Expand Down Expand Up @@ -234,14 +232,6 @@ const Nav = (props) => {
document.body.classList.remove("nav-open");
};

const closeDrawer = (event) => {
const ele = event.target;
if (ele.closest(".inner-drawer-nav")) {
return;
}
closeNavigation();
};

const menuButtonClickAction = () => {
setSectionDrawerOpen(!isSectionDrawerOpen);
document.body.classList.toggle("nav-open");
Expand Down Expand Up @@ -283,7 +273,6 @@ const Nav = (props) => {
return (
<PresentationalNav
ariaLabelLink={ariaLabelLink}
closeDrawer={closeDrawer}
customFields={customFields}
displayLinks={displayLinks}
horizontalLinksHierarchy={horizontalLinksHierarchy}
Expand Down

0 comments on commit 8a5274c

Please sign in to comment.