mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-25 01:53:44 +03:00
fix: search and navigate error
This commit is contained in:
parent
4dbde2bcc0
commit
cfd810fdf9
|
@ -132,12 +132,13 @@ export class SearchBox extends React.PureComponent<SearchBoxProps, SearchBoxStat
|
|||
|
||||
render() {
|
||||
const { activeItemIdx } = this.state;
|
||||
const results = this.state.results.map(res => ({
|
||||
const results = this.state.results
|
||||
.filter(res => this.props.getItemById(res.meta))
|
||||
.map(res => ({
|
||||
item: this.props.getItemById(res.meta)!,
|
||||
score: res.score,
|
||||
}));
|
||||
|
||||
results.sort((a, b) => b.score - a.score);
|
||||
}))
|
||||
.sort((a, b) => b.score - a.score);
|
||||
|
||||
return (
|
||||
<SearchWrap role="search">
|
||||
|
|
Loading…
Reference in New Issue
Block a user