chat: fix ship search not wrapping correctly

fixes #2832
This commit is contained in:
Liam Fitzgerald 2020-05-05 16:17:45 +10:00
parent 23eb4acc37
commit 6fb41209cd

View File

@ -233,7 +233,7 @@ export class ShipSearch extends Component {
let idx = suggestions.findIndex(s => s === this.state.selected);
idx = backward ? idx - 1 : idx + 1;
idx = idx % suggestions.length;
idx = idx % Math.min(suggestions.length, 5);
if (idx < 0) {
idx = suggestions.length - 1;
}