Merge pull request #4955 from GabrielInTheWorld/hotfixSuperSearch
Hotfix for global search
This commit is contained in:
commit
899eedf403
@ -213,7 +213,9 @@ export class SearchService {
|
||||
.filter(model =>
|
||||
dedicatedId
|
||||
? model.id === dedicatedId
|
||||
: model.formatForSearch().searchValue.some(text => text.toLowerCase().indexOf(query) !== -1)
|
||||
: model
|
||||
.formatForSearch()
|
||||
.searchValue.some(text => text && text.toLowerCase().indexOf(query) !== -1)
|
||||
)
|
||||
.sort((a, b) => {
|
||||
switch (sortingProperty) {
|
||||
|
@ -304,14 +304,16 @@ export class SuperSearchComponent implements OnInit {
|
||||
* @param event KeyboardEvent to listen to keyboard-inputs.
|
||||
*/
|
||||
@HostListener('document:keydown', ['$event']) public onKeyNavigation(event: KeyboardEvent): void {
|
||||
if (event.key === 'Enter') {
|
||||
this.viewResult(this.selectedModel);
|
||||
}
|
||||
if (event.key === 'ArrowUp') {
|
||||
this.selectNextResult(true);
|
||||
}
|
||||
if (event.key === 'ArrowDown') {
|
||||
this.selectNextResult(false);
|
||||
if (!!this.selectedModel) {
|
||||
if (event.key === 'Enter') {
|
||||
this.viewResult(this.selectedModel);
|
||||
}
|
||||
if (event.key === 'ArrowUp') {
|
||||
this.selectNextResult(true);
|
||||
}
|
||||
if (event.key === 'ArrowDown') {
|
||||
this.selectNextResult(false);
|
||||
}
|
||||
}
|
||||
if (event.altKey && event.shiftKey && event.key === 'V') {
|
||||
this.showPreview = !this.showPreview;
|
||||
|
Loading…
Reference in New Issue
Block a user