scripty2 icon indicating copy to clipboard operation
scripty2 copied to clipboard

Autocomplete on HTML5 inputs (emails, tel, ...)

Open ZenCocoon opened this issue 13 years ago • 4 comments

Hi,

Wishing to add autocomplete support on the new HTML5 input types, like email, tel, ..., I realized that it's blocked to "text" types so far : https://github.com/madrobby/scripty2/blob/master/src/ui/controls/autocompleter.js#L23

I guess the main goal being to avoid "submit" types right? Would you consider the following selector input:not([type="submit"]) proper as a replacement ?

Hoping that helps, Best regards,

  • Sébastien Grosjean - ZenCocoon

ZenCocoon avatar Nov 07 '11 18:11 ZenCocoon

Not only that - you would have to exclude also "reset", "hidden", "radio", "checkbox", "button" and probably some other types also.

rafalwrzeszcz avatar Nov 07 '11 19:11 rafalwrzeszcz

That's a good point, there's actually way more that would not make sense (datetime, range, ...), thanks for pointing that out.

It's then better to pick only the potential ones then. What would you think of allowing the following types : text, email, tel, url, search

ZenCocoon avatar Nov 07 '11 20:11 ZenCocoon

I think this is exacly what we need.

rafalwrzeszcz avatar Nov 07 '11 20:11 rafalwrzeszcz

The following selector works but wonder if something cleaner would exist ?

input[type="text"],input[type="email"],input[type="tel"],input[type="url"],input[type="search"]

ZenCocoon avatar Nov 08 '11 14:11 ZenCocoon