[Webkit-unassigned] [Bug 161506] [iOS] input pattern="[0-9.]*" should use DecimalPad keyboard

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 6 00:24:53 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=161506

--- Comment #4 from Darryl Pogue <dvpdiner2 at gmail.com> ---
I agree the regex isn't an ideal solution. I was trying to brainstorm something more flexible than string comparisons though, and this was the best I came up with.

One complaint of the current string comparison whitelisting is that it makes it hard for people to use the pattern attribute for actual validations. If you want to collect a 5-digit number, the best pattern would be "\d{5}", but that causes iOS to opt-out of the number pad keyboard because it doesn't match the whitelist.


It's not obvious what the string comparison should be for a decimal pad, since the naïve "[0-9\.]*" would actually allow multiple decimal points to validate. Suggested patterns from online resources include "\d*\.\d*" or "[0-9]*\.[0-9]*", but both of those make the decimal point required.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160906/611a3255/attachment.html>


More information about the webkit-unassigned mailing list