From 261f9d4df5fe0e21687797ba7f0fb30f4c38ccda Mon Sep 17 00:00:00 2001 From: Kyle Kemp Date: Thu, 15 Aug 2024 15:40:42 -0500 Subject: [PATCH] fix effect searching --- .../input-effect/input-effect.component.html | 4 ++-- .../components/input-effect/input-effect.component.ts | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/app/shared/components/input-effect/input-effect.component.html b/src/app/shared/components/input-effect/input-effect.component.html index 254872b..41787cd 100644 --- a/src/app/shared/components/input-effect/input-effect.component.html +++ b/src/app/shared/components/input-effect/input-effect.component.html @@ -1,6 +1,6 @@
+ (change)="change.emit($event?.value)" [compareWith]="itemCompare" [searchFn]="search">
@@ -14,4 +14,4 @@ {{ label() }} -
+
\ No newline at end of file diff --git a/src/app/shared/components/input-effect/input-effect.component.ts b/src/app/shared/components/input-effect/input-effect.component.ts index 6ae6a36..0d90bef 100644 --- a/src/app/shared/components/input-effect/input-effect.component.ts +++ b/src/app/shared/components/input-effect/input-effect.component.ts @@ -38,4 +38,15 @@ export class InputEffectComponent { constructor() { this.electronService.requestJSON('effect-data'); } + + public itemCompare( + itemA: { value: string; desc: string }, + itemB: { value: string; desc: string } + ): boolean { + return itemA.value === itemB.value; + } + + public search(term: string, item: { value: string }) { + return item.value.toLowerCase().includes(term.toLowerCase()); + } }