Browse Source
Render abp-select info as <div class="form-text"> with aria-describedby
- Replace <small> with <div> to match abp-input and the Bootstrap 5 form-text guidance
- Add aria-describedby on the select so screen readers announce the description
pull/25352/head
maliming
3 weeks ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
7 additions and
5 deletions
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs
@ -251,12 +251,14 @@ public class AbpSelectTagHelperService : AbpTagHelperService<AbpSelectTagHelper>
var idAttr = inputTag . Attributes . FirstOrDefault ( a = > a . Name = = "id" ) ;
var localizedText = _ tagHelperLocalizer . GetLocalizedText ( text , TagHelper . AspFor . ModelExplorer ) ;
var small = new TagBuilder ( "small " ) ;
small . Attributes . Add ( "id" , idAttr ? . Value ? . ToString ( ) + "InfoText" ) ;
small . AddCssClass ( "form-text" ) ;
small . InnerHtml . Append ( localizedText ) ;
var div = new TagBuilder ( "div " ) ;
div . Attributes . Add ( "id" , idAttr ? . Value + "InfoText" ) ;
div . AddCssClass ( "form-text" ) ;
div . InnerHtml . Append ( localizedText ) ;
return small . ToHtmlString ( ) ;
inputTag . Attributes . Add ( "aria-describedby" , idAttr ? . Value + "InfoText" ) ;
return div . ToHtmlString ( ) ;
}
protected virtual List < SelectListItem > GetSelectItemsFromEnum ( TagHelperContext context , TagHelperOutput output , ModelExplorer explorer )