mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-03-26 18:13:32 -04:00
fixed text filter to work on Enter
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
placeholder="Search events..."
|
||||
type="search"
|
||||
[(value)]="searchQuery"
|
||||
(blurred)="onFilterChange()"
|
||||
(entered)="onFilterChange()"
|
||||
/>
|
||||
</div>
|
||||
<div class="toolbar__actions">
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
placeholder="Search by title..."
|
||||
type="search"
|
||||
[(value)]="searchQuery"
|
||||
(blurred)="onFilterChange()"
|
||||
(entered)="onFilterChange()"
|
||||
/>
|
||||
<app-select
|
||||
[value]="sortBy()"
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
placeholder="Search by title..."
|
||||
type="search"
|
||||
[(value)]="searchQuery"
|
||||
(blurred)="onSearchFilterChange()"
|
||||
(entered)="onSearchFilterChange()"
|
||||
/>
|
||||
</div>
|
||||
<div class="toolbar__actions">
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
[readOnly]="readonly()"
|
||||
[(ngModel)]="value"
|
||||
(blur)="blurred.emit($event)"
|
||||
(keydown.enter)="entered.emit()"
|
||||
(search)="onSearchCleared($event)"
|
||||
/>
|
||||
@if (hasEye()) {
|
||||
<button type="button" class="input-eye-btn" (click)="toggleSecret($event)" [attr.aria-label]="showSecret() ? 'Hide password' : 'Show password'">
|
||||
|
||||
@@ -28,6 +28,7 @@ export class InputComponent {
|
||||
inputRef = viewChild<ElementRef<HTMLInputElement>>('inputEl');
|
||||
|
||||
blurred = output<FocusEvent>();
|
||||
entered = output<void>();
|
||||
|
||||
readonly showSecret = signal(false);
|
||||
readonly hasEye = computed(() => this.type() === 'password' && this.revealable());
|
||||
@@ -46,6 +47,13 @@ export class InputComponent {
|
||||
this.showSecret.update(v => !v);
|
||||
}
|
||||
|
||||
onSearchCleared(event: Event): void {
|
||||
const input = event.target as HTMLInputElement;
|
||||
if (input.value === '') {
|
||||
this.entered.emit();
|
||||
}
|
||||
}
|
||||
|
||||
onHelpClick(event: Event): void {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
Reference in New Issue
Block a user