mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
fix: search box animating on small screen (#4076)
This commit is contained in:
@@ -96,7 +96,10 @@ export default abstract class AbstractSearch<T extends SearchAttrs = SearchAttrs
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
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
|
<Input
|
||||||
type="search"
|
type="search"
|
||||||
className="Search-input"
|
className="Search-input"
|
||||||
@@ -112,7 +115,6 @@ export default abstract class AbstractSearch<T extends SearchAttrs = SearchAttrs
|
|||||||
else this.searchState.setValue(value);
|
else this.searchState.setValue(value);
|
||||||
}}
|
}}
|
||||||
inputAttrs={{
|
inputAttrs={{
|
||||||
onclick: () => setTimeout(() => openSearchModal(), 150),
|
|
||||||
// for keyboard navigation, click event would be triggered on keydown
|
// for keyboard navigation, click event would be triggered on keydown
|
||||||
onkeydown: (e: KeyboardEvent) => {
|
onkeydown: (e: KeyboardEvent) => {
|
||||||
if (e.key === 'Enter') {
|
if (e.key === 'Enter') {
|
||||||
|
Reference in New Issue
Block a user