Opened 7 years ago
Closed 9 months ago
#40610 closed defect (bug) (fixed)
HTML5 Validation error in Screen Options > Pagination
Reported by: | Arena94 | Owned by: | joedolson |
---|---|---|---|
Milestone: | 6.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | has-patch has-screenshots commit |
Focuses: | Cc: |
Description
Error: Attribute “maxlength” is only allowed when the input type is “email”, “password”, “search”, “tel”, “text”, or “url”.
Attachments (2)
Change History (11)
#2
@
7 years ago
- Keywords has-screenshots added
- Milestone changed from Awaiting Review to 4.8
- Version trunk deleted
@Arena94 thanks for your patch.
Looking back for some history, this input type was changed from text
to number
in [20168], see #17863. Seems the maxlength
attribute was kept for some backwards compatibility concerns. However, the next 4.8 release is going to drop support for old IEs so maybe worth considering to remove it.
Worth noting seems browsers have all sorts of different behaviours, most of them allow to enter more than 3 characters ignoring the max="999"
and maxlength="3"
attributes when manually entering numbers, regardless of the presence of the attribute (it only works when the input type is text
).
As far as I see, removing maxlength="3"
makes some difference just in IE11 and Edge. With maxlength="3"
it's not possible to manually enter more than 3 numbers. Without maxlength="3"
it becomes possible. It is always possible when the entered value starts with an alpha character.
Chrome Mac (doesn't honor max and maxlength when manually entering numbers)
Firefox Mac (doesn't prevent alpha characters input, doesn't honor max and maxlength when manually entering numbers)
IE11 (doesn't prevent alpha characters input, doesn't honor max and maxlength when entering a mix of alpha characters and numbers)
Edge (same as IE11 plus doesn't honor max when incrementing the field value using the up arrow)
Moving to 4.8 consideration.
This ticket was mentioned in Slack in #core by obenland. View the logs.
7 years ago
#7
@
12 months ago
- Milestone changed from Future Release to 6.5
- Owner set to joedolson
- Status changed from new to accepted
This is pretty trivial; let's resolve it.
patch