Opened 11 years ago
Closed 11 years ago
#24475 closed defect (bug) (fixed)
The empty pattern attribute causes Webkit (Chromium 25) to style the URL and Email HTML5 form fields always with :invalid styles.
Reported by: | nico23 | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | normal | Version: | 3.6 |
Component: | Comments | Keywords: | dev-feedback ui-feedback ux-feedback |
Focuses: | Cc: |
Description
Chromium Version 25.0.1364.160 Ubuntu 13.04 (25.0.1364.160-0ubuntu3)
input type="email" pattern=""
input type="url" pattern=""
This code is generated for the HTML5 form in Wordpress.
I am using bootstrap 3.0 CSS and it styles the input:focus:invalid:focus
and input:focus:invalid
with a red border and text. The issue is using the empty pattern variable the browsers marks everything as invalid. I simply removed the pattern=""
and the validation works, the browser then uses default pattern and the styles get removed as soon as the input in that fields are valid. I not tested it with manual pattern that will of course work as well.
Not sure what the reason is you used empty pattern, I am new to this thing, but you might want to remove it or include some default pattern to be able to correctly validate the Email and URL.
Attachments (1)
Change History (8)
#3
@
11 years ago
georgestephanis — was there a reason you had a blank pattern instead of just omitting the attribute?
#4
@
11 years ago
Looks like there was some discussion on 15080 about the pattern attribute.
#5
@
11 years ago
Sounds like we should be good to remove it, based on the context aaroncampbell provided. See patch.
#6
@
11 years ago
I can't replicate this in Version 27.0.1453.116 or Version 30.0.1558.0 canary. That said, there is enough browser inconsistency here that bootstrap removed it from the 3.0 branch 15 days ago .
Pattern was needed because of buggy support in Opera when the patch for this was originally written (Opera 10.6). Now (as of version 11) Opera supports novalidate, so removing the blank patterns should be fine. I don't know if we have oficial versions of Opera that we support, but using the general rule of stable -1, we are safe since Opera is now on version 15.
tl;dr; I support Committing Mark's patch
Introduced in [23689], see ticket:15080:29 and also #22183.