1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 05:43:41 +00:00

[PM-8582] Improve search performance in Safari (#11088)

This commit is contained in:
Victoria League
2024-09-18 09:13:58 -04:00
committed by GitHub
parent 502d8ed729
commit bd4b3933a4
3 changed files with 7 additions and 2 deletions

View File

@@ -10,7 +10,7 @@
<input
#input
bitInput
type="search"
[type]="inputType"
[id]="id"
[placeholder]="placeholder ?? ('search' | i18n)"
class="tw-rounded-l tw-pl-9"

View File

@@ -1,6 +1,8 @@
import { Component, ElementRef, Input, ViewChild } from "@angular/core";
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
import { isBrowserSafariApi } from "@bitwarden/platform";
import { FocusableElement } from "../shared/focusable-element";
let nextId = 0;
@@ -28,6 +30,8 @@ export class SearchComponent implements ControlValueAccessor, FocusableElement {
protected id = `search-id-${nextId++}`;
protected searchText: string;
// Use `type="text"` for Safari to improve rendering performance
protected inputType = isBrowserSafariApi() ? ("text" as const) : ("search" as const);
@Input() disabled: boolean;
@Input() placeholder: string;