mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-19 14:06:33 +02:00
Enhance inputCloned text input with type and name (#908)
* Enhance inputCloned text input with type and name Safari will display a contact autocomplete on every text input which `name` attribute contains "*name*" or does not have any `name` attribute. Adding a fine tuned `name`attribute to the input should prevent that. Plus, input type="search" seems more suited to the field intent (https://developer.mozilla.org/fr/docs/Web/HTML/Element/Input/search). * Adapt inputCloned related test
This commit is contained in:
parent
b92823b70c
commit
82b94228f9
|
@ -494,7 +494,8 @@ describe('templates', () => {
|
||||||
*/
|
*/
|
||||||
const expectedOutput = strToEl(`
|
const expectedOutput = strToEl(`
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="search"
|
||||||
|
name="search_terms"
|
||||||
class="${classes.input} ${classes.inputCloned}"
|
class="${classes.input} ${classes.inputCloned}"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
role="textbox"
|
role="textbox"
|
||||||
|
|
|
@ -267,7 +267,8 @@ const templates = {
|
||||||
placeholderValue: string,
|
placeholderValue: string,
|
||||||
): HTMLInputElement {
|
): HTMLInputElement {
|
||||||
const inp = Object.assign(document.createElement('input'), {
|
const inp = Object.assign(document.createElement('input'), {
|
||||||
type: 'text',
|
type: 'search',
|
||||||
|
name: 'search_terms',
|
||||||
className: `${input} ${inputCloned}`,
|
className: `${input} ${inputCloned}`,
|
||||||
autocomplete: 'off',
|
autocomplete: 'off',
|
||||||
autocapitalize: 'off',
|
autocapitalize: 'off',
|
||||||
|
|
Loading…
Reference in a new issue