mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-21 16:18:28 +01:00
[PM-8582] Improve search performance in Safari (#11088)
This commit is contained in:
parent
502d8ed729
commit
bd4b3933a4
@ -10,7 +10,7 @@
|
||||
<input
|
||||
#input
|
||||
bitInput
|
||||
type="search"
|
||||
[type]="inputType"
|
||||
[id]="id"
|
||||
[placeholder]="placeholder ?? ('search' | i18n)"
|
||||
class="tw-rounded-l tw-pl-9"
|
||||
|
@ -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;
|
||||
|
@ -20,7 +20,8 @@
|
||||
"lib": ["es2020", "dom"],
|
||||
"paths": {
|
||||
"@bitwarden/common/*": ["../common/src/*"],
|
||||
"@bitwarden/angular/*": ["../angular/src/*"]
|
||||
"@bitwarden/angular/*": ["../angular/src/*"],
|
||||
"@bitwarden/platform": ["../platform/src"]
|
||||
}
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
|
Loading…
Reference in New Issue
Block a user