Skip to content

Commit

Permalink
fix: search box animating on small screen (#4076)
Browse files Browse the repository at this point in the history
  • Loading branch information
YUCLing authored Oct 23, 2024
1 parent ea9b059 commit e030c1e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions framework/core/js/src/common/components/AbstractSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ export default abstract class AbstractSearch<T extends SearchAttrs = SearchAttrs
};

return (
<div role="search" className="Search" aria-label={this.attrs.a11yRoleLabel}>
<div role="search" className="Search" aria-label={this.attrs.a11yRoleLabel} onclick={() => {
this.$('input').blur();
setTimeout(() => openSearchModal(), 150);
}}>
<Input
type="search"
className="Search-input"
Expand All @@ -112,7 +115,6 @@ export default abstract class AbstractSearch<T extends SearchAttrs = SearchAttrs
else this.searchState.setValue(value);
}}
inputAttrs={{
onclick: () => setTimeout(() => openSearchModal(), 150),
// for keyboard navigation, click event would be triggered on keydown
onkeydown: (e: KeyboardEvent) => {
if (e.key === 'Enter') {
Expand Down

0 comments on commit e030c1e

Please sign in to comment.