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:
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user