1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

UIF - Prefer signal & change detection (#16940)

This commit is contained in:
Oscar Hinton
2025-10-21 18:52:40 +02:00
committed by GitHub
parent d3fc20f8b9
commit 65da23feaa
135 changed files with 503 additions and 51 deletions

View File

@@ -18,6 +18,8 @@ let nextId = 0;
/**
* Do not nest Search components inside another `<form>`, as they already contain their own standalone `<form>` element for searching.
*/
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
selector: "bit-search",
templateUrl: "./search.component.html",
@@ -45,10 +47,12 @@ export class SearchComponent implements ControlValueAccessor, FocusableElement {
// Use `type="text"` for Safari to improve rendering performance
protected inputType = isBrowserSafariApi() ? ("text" as const) : ("search" as const);
protected isInputFocused = signal(false);
protected isFormHovered = signal(false);
protected readonly isInputFocused = signal(false);
protected readonly isFormHovered = signal(false);
protected showResetButton = computed(() => this.isInputFocused() || this.isFormHovered());
protected readonly showResetButton = computed(
() => this.isInputFocused() || this.isFormHovered(),
);
readonly disabled = model<boolean>();
readonly placeholder = input<string>();