Skip to content

Commit

Permalink
Avoid wrong interpretation of search bar by browser extension (e.g. 1…
Browse files Browse the repository at this point in the history
…Password)

Some browser extension like 1Password could interpret the search bar as an
normal input field and provided an auto fill. For user with 1Password this was
very annoying as you certainly never wants to have a search input field automatically
filled with user credentials or user personal infos.

To avoid this use the standard search input type and also added some standard
attribute to improve user experience.
  • Loading branch information
ltshb committed Jul 8, 2024
1 parent e9f1f3d commit 820af83
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/modules/menu/components/search/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,17 @@ const onInputClicked = () => {
</span>
<input
ref="searchInput"
type="text"
type="search"
class="form-control text-truncate"
:class="{
'rounded-bottom-0': showResults,
'rounded-start': isPhoneMode,
'rounded-end': !searchValue,
}"
:placeholder="$t('search_placeholder')"
autocapitalize="off"
autocorrect="off"
spellcheck="false"
aria-label="Search"
aria-describedby="searchIconText clearSearchButton"
:value="searchValue"
Expand Down Expand Up @@ -190,4 +193,11 @@ const onInputClicked = () => {
<style lang="scss" scoped>
@import '@/scss/media-query.mixin';
// Prevent clear icon of search input on certain browser like chrome, the clear icon is added
// manually using bootstrap see template above.
input[type='search']::-webkit-search-cancel-button {
-webkit-appearance: none;
appearance: none;
}
</style>

0 comments on commit 820af83

Please sign in to comment.