mirror of
https://github.com/flarum/framework.git
synced 2025-04-14 07:03:04 +08:00
PERF: Only show search results when field has focus
This commit is contained in:
parent
178474adf9
commit
21c3978e76
@ -93,9 +93,13 @@ export default class Search extends Component {
|
||||
? <button className="Search-clear Button Button--icon Button--link" onclick={this.clear.bind(this)}>{icon('times-circle')}</button>
|
||||
: ''}
|
||||
</div>
|
||||
<ul className="Dropdown-menu Search-results">
|
||||
{this.sources.map(source => source.view(this.value()))}
|
||||
</ul>
|
||||
{this.value() && this.hasFocus
|
||||
? (
|
||||
<ul className="Dropdown-menu Search-results">
|
||||
{this.sources.map(source => source.view(this.value()))}
|
||||
</ul>
|
||||
)
|
||||
: ''}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user