You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reading options from an array the code (beginning at line 1074) is missing two attributes, text and disabled. I would also submit that the code should not presuppose the desire of the data provider to want the label attribute to be set with contents of the value attribute (should the label be omitted). The definition of the label attribute indicates that if omitted, it should contain the 'text' value (done in the browser). In addition, Firefox requires the text attribute as it will not display the label.
If anything (although I would argue against it), if the text value is omitted, it should be set to the label (if exists and value exists) or to the value (if exists and no label supplied).
Also, the disabled attribute is missing as it is a proper attribute in both the optiongroup and option tags.
var optgroups = [
{
label: 'Dade', disabled: 'disabled', children: [
{label: 'Miami', value: 'Miami'},
{label: 'HollyWood', value: 'Hollywood', title: 'this is a group'}
]
},
{
label: 'West Central', children: [
{label: 'This is the label - no value', text: 'This is text - no value', selected: 'selected'},
{label: 'This is the label - no text', value: 'this is value - no text', selected: 'selected'},
{value: 'this is the value - no label', text: 'this is the text - no label', selected: 'selected'},
{value: 'this is the value - no label - no text', selected: 'selected'},
{label: 'This is the label - no value - no text', selected: 'selected'},
{text: 'this is the text - no label - no value', selected: 'selected'},
{label: 'This is the label', value: 'this is the value', title: 'this is the title', text: 'This is text', selected: 'selected'},
{label: 'This is the label - no value', text: 'this is text - no value', selected: 'selected'}
]
}
];
This was the resulting selection group in IE11 (will show the label if no text is supplied). Firefox will have a blank line if text is not provided:
<select id="CityList" class="multiselect form-control" name="CityList[]" multiple="multiple" style="display: none;">
<optgroup label="Dade" disabled="disabled">
<option value="Miami" label="Miami"></option>
<option value="Hollywood" label="HollyWood" title="this is a group"></option>
</optgroup>
<optgroup label="West Central">
<option label="This is the label - no value" selected="selected">This is text - no value</option> = LABEL IS DISPLAYED IN LIST
<option value="this is value - no text" label="This is the label - no text" selected="selected"></option> = LABEL IS DISPLAYED IN LIST
<option value="this is the value - no label" selected="selected">this is the text - no label</option> = TEXT IS DISPLAYED IN LIST
<option value="this is the value - no label - no text" selected="selected"></option> = BLANK DISPLAYED IN LIST
<option label="This is the label - no value - no text" selected="selected"></option> = LABEL IS DISPLAYED IN LIST (no value passed)
<option selected="selected">this is the text - no label - no value</option> = TEXT IS DISPLAYED IN LIST
<option value="this is the value" label="This is the label" title="this is the title" selected="selected">This is text</option> = LABEL IS DISPLAYED IN LIST
<option label="This is the label - no value" selected="selected">this is text - no value</option> = LABEL IS DISPLAYED IN LIST
</optgroup>
</select>
Please consider updating the code. Let the developer be responsible for providing the correct data in the passed array. Maybe you could update the instructions to indicate that different browsers handle the options differently. However, the text attribute is a MUST!
Thanks.
The text was updated successfully, but these errors were encountered:
When reading options from an array the code (beginning at line 1074) is missing two attributes, text and disabled. I would also submit that the code should not presuppose the desire of the data provider to want the label attribute to be set with contents of the value attribute (should the label be omitted). The definition of the label attribute indicates that if omitted, it should contain the 'text' value (done in the browser). In addition, Firefox requires the text attribute as it will not display the label.
If anything (although I would argue against it), if the text value is omitted, it should be set to the label (if exists and value exists) or to the value (if exists and no label supplied).
Also, the disabled attribute is missing as it is a proper attribute in both the optiongroup and option tags.
Here is my suggested correction:
The data used for my testing was as follows:
This was the resulting selection group in IE11 (will show the label if no text is supplied). Firefox will have a blank line if text is not provided:
Please consider updating the code. Let the developer be responsible for providing the correct data in the passed array. Maybe you could update the instructions to indicate that different browsers handle the options differently. However, the text attribute is a MUST!
Thanks.
The text was updated successfully, but these errors were encountered: