mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Add enter key hints for search (#31298)
Adds https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint to the search inputs. This hint is used for mobile devices to guide what label is shown on the onscreen keyboard. By default `return` is shown, now for search we will see `search`. Also add `type="search"` to the full page search input for further guidance.
This commit is contained in:
parent
b3a686ca4e
commit
8ab57e4266
@ -2,6 +2,7 @@
|
|||||||
id={{this.inputId}}
|
id={{this.inputId}}
|
||||||
type="search"
|
type="search"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
|
enterkeyhint="search"
|
||||||
value={{this.search.activeGlobalSearchTerm}}
|
value={{this.search.activeGlobalSearchTerm}}
|
||||||
placeholder={{i18n "search.title"}}
|
placeholder={{i18n "search.title"}}
|
||||||
aria-label={{i18n "search.title"}}
|
aria-label={{i18n "search.title"}}
|
||||||
|
@ -7,6 +7,7 @@ import { i18n } from "discourse-i18n";
|
|||||||
|
|
||||||
export default class SearchTextField extends TextField {
|
export default class SearchTextField extends TextField {
|
||||||
autocomplete = "off";
|
autocomplete = "off";
|
||||||
|
enterkeyhint = "search";
|
||||||
|
|
||||||
@discourseComputed("searchService.searchContextEnabled")
|
@discourseComputed("searchService.searchContextEnabled")
|
||||||
placeholder(searchContextEnabled) {
|
placeholder(searchContextEnabled) {
|
||||||
|
@ -11,6 +11,7 @@ const DEBOUNCE_MS = 500;
|
|||||||
"autocorrect",
|
"autocorrect",
|
||||||
"autocapitalize",
|
"autocapitalize",
|
||||||
"autofocus",
|
"autofocus",
|
||||||
|
"enterkeyhint",
|
||||||
"maxLength",
|
"maxLength",
|
||||||
"dir",
|
"dir",
|
||||||
"aria-label",
|
"aria-label",
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
@enter={{action "search" (hash collapseFilters=true)}}
|
@enter={{action "search" (hash collapseFilters=true)}}
|
||||||
@hasAutofocus={{this.hasAutofocus}}
|
@hasAutofocus={{this.hasAutofocus}}
|
||||||
@aria-controls="search-result-count"
|
@aria-controls="search-result-count"
|
||||||
|
type="search"
|
||||||
class="full-page-search search no-blur search-query"
|
class="full-page-search search no-blur search-query"
|
||||||
/>
|
/>
|
||||||
<ComboBox
|
<ComboBox
|
||||||
|
Loading…
Reference in New Issue
Block a user