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
{{ message }}
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
Current <select/> tag helper only sets selected attributes for <option/> elements generated from the items enumeration. Should support adding this attribute to <option/> elements users provide. E.g. f the Razor source contains
<select for="YearsEmployeed"><option value="">Why didn't you select anything?</option><option value="0">Less than 1</option><option value="1">1</option><option value="2">2</option><option value="3">3</option></select>
the generated code should select the <option value="1"> element when Model.YearsEmployed is 1.
As an added bonus, could perform no automatic selection if the user explicitly provides a selected attribute on one of their options. E.g. if the Razor source contains
<selectfor="YearsEmployeed" items="SelectList"><option value="">Why didn't you select anything?</option><option value="0">Less than 1</option><option value="1">1</option><option value="2" selected="selected">2</option><option value="3">3</option></select>
the generated code should include only a single selected attribute even if SelectList contains a SelectListItem for 4 and that's the current Model.YearsEmployed value.
If we decide to support this enhancement, it may need to be tracked as a separate issue.
The text was updated successfully, but these errors were encountered:
Current
<select/>
tag helper only setsselected
attributes for<option/>
elements generated from theitems
enumeration. Should support adding this attribute to<option/>
elements users provide. E.g. f the Razor source containsthe generated code should select the
<option value="1">
element whenModel.YearsEmployed
is1
.As an added bonus, could perform no automatic selection if the user explicitly provides a
selected
attribute on one of their options. E.g. if the Razor source containsthe generated code should include only a single
selected
attribute even ifSelectList
contains aSelectListItem
for4
and that's the currentModel.YearsEmployed
value.If we decide to support this enhancement, it may need to be tracked as a separate issue.
The text was updated successfully, but these errors were encountered: