From db5e23ba6ae42630815b01a4837a1db1e435c8c2 Mon Sep 17 00:00:00 2001 From: Bob Maerten Date: Thu, 24 Sep 2020 16:25:39 +0200 Subject: [PATCH] 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). --- src/scripts/templates.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scripts/templates.ts b/src/scripts/templates.ts index 4d4af87..15d2ce0 100644 --- a/src/scripts/templates.ts +++ b/src/scripts/templates.ts @@ -267,7 +267,8 @@ const templates = { placeholderValue: string, ): HTMLInputElement { const inp = Object.assign(document.createElement('input'), { - type: 'text', + type: 'search', + name: 'search_terms', className: `${input} ${inputCloned}`, autocomplete: 'off', autocapitalize: 'off',