Opened 5 years ago
Last modified 3 years ago
#7993 new enhancement
Missing tabindex argument for wp_dropdown generated inputs
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Template | Version: | 2.7 |
| Severity: | minor | Keywords: | gsoc has-patch |
| Cc: | wojtek.szkutnik@… |
Description
http://codex.wordpress.org/Template_Tags/wp_dropdown_categories allows to create a select for categories.
There is no tabindex option in common arguments, which is a loss for usability.
There could be other functions affected.
Attachments (2)
Change History (10)
comment:3
wojtek.szkutnik — 3 years ago
- Cc wojtek.szkutnik@… added
- Keywords gsoc has-patch added
wojtek.szkutnik — 3 years ago
"which is a loss for usability" -- tabindex is generally decried as poor usability that should be used sparingly. Not to suggest that there aren't valid use cases for having the argument in wp_dropdown_*, but I'm almost -1 just because the attribute is so misused.
comment:5
wojtek.szkutnik — 3 years ago
Shouldn't all wp_dropdown_* functions be consistent? The current version of wp_dropdown_categories already has a tab_index argument, while my patch fixes wp_dropdown_users and wp_dropdown_pages. We should either allow tab_index everywhere or remove it from wp_dropdown_categories.
I don't have a problem with adding it, only I wanted to clarify that it is not a usability issue as originally stated.
Re: the patch, it doesn't look like it is properly sanitized.. The cast would only affect the comparison. Ideally it should default to false. If !== false, then absint() and use it. (0 is allowed as a tabindex value.)
wojtek.szkutnik — 3 years ago
comment:7
wojtek.szkutnik — 3 years ago
Good point - fixed it in all three functions.

wp_dropdown)user affected as well