mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-02-17 23:45:29 -05:00
refactor: navigate to selected package on enter key press (#1122)
This commit is contained in:
parent
903bd0b091
commit
c8939a2792
1 changed files with 1 additions and 6 deletions
|
@ -217,15 +217,10 @@ export default class App extends Component {
|
|||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
handleClickSearch = (_, { suggestionValue, method }) => {
|
||||
const { packages } = this.state;
|
||||
switch(method) {
|
||||
case 'click':
|
||||
window.location.href = getDetailPageURL(suggestionValue);
|
||||
break;
|
||||
case 'enter':
|
||||
this.setState({
|
||||
filteredPackages: packages.filter(pkg => pkg.label.match(suggestionValue))
|
||||
});
|
||||
window.location.href = getDetailPageURL(suggestionValue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue