mirror of
https://github.com/flarum/framework.git
synced 2024-11-22 12:48:28 +08:00
fix: search box animating on small screen (#4076)
This commit is contained in:
parent
ea9b059f70
commit
e030c1ee8c
|
@ -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') {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user