mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-28 11:33:43 +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() {
|
render() {
|
||||||
const { activeItemIdx } = this.state;
|
const { activeItemIdx } = this.state;
|
||||||
const results = this.state.results.map(res => ({
|
const results = this.state.results
|
||||||
item: this.props.getItemById(res.meta)!,
|
.filter(res => this.props.getItemById(res.meta))
|
||||||
score: res.score,
|
.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 (
|
return (
|
||||||
<SearchWrap role="search">
|
<SearchWrap role="search">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user