Description
Before submitting...
- I have searched for duplicate or closed issues.
- I have read the CONTRIBUTING document and my issue is following the guidelines.
- I have read the template completely before filling it in.
Context
The _SetupDropdown method that gets run when the select is initialized sets the tabIndex property on the original select element to -1, but does not set any tabIndex property on the text input element that it creates. The end result is that any form that contains select elements can not have a predefined tab order.
Current Behavior
It is impossible to set a specific tab order for select elements
Expected behavior
It should be possible to specify a tabIndex property on a select element and have that property applied to the input element created during initialization.
Possible Solutions or Causes
I think this is a relatively easy issue to fix in the _SetupDropdown method. Just set the tabIndex property on the input element to match the value on the original select element.
Steps to reproduce
Create any page containing a form with a select element.
View the DOM and observe that there is no tabIndex property on the input element created during initialization.
Your Environment
- Version used: v2.1.0 and v2.1.1
- Browser Name and version: all
- Operating System and version (desktop or mobile): all
- Additional information you want to tell us:
I created a kludgy workaound by adding a tabIndex property to the label on the select element, and then running this javascript after initialization:
var labelEls = document.getElementsByTagName("label");
for (i=0; i < labelEls.length; i++) {
if (labelEls[i].id.startsWith('m_select')) {
if (labelEls[i].tabIndex > 0) {
//console.log( labelEls[i].htmlFor + ' tabindex ' + labelEls[i].tabIndex );
document.getElementById(labelEls[i].htmlFor).tabIndex = labelEls[i].tabIndex;
labelEls[i].tabIndex = -1;
}
}
}