Skip to content

Render abp-select info as <div class="form-text"> with aria-describedby#25352

Merged
enisn merged 7 commits intorel-10.2from
maliming/abp-select-info-as-div
May 4, 2026
Merged

Render abp-select info as <div class="form-text"> with aria-describedby#25352
enisn merged 7 commits intorel-10.2from
maliming/abp-select-info-as-div

Conversation

@maliming
Copy link
Copy Markdown
Member

@maliming maliming commented May 1, 2026

Render <abp-select> info text as <div class="form-text"> to match <abp-input> and Bootstrap 5, and wire up aria-describedby on the <select>.

Along the way, fix several pre-existing issues that also affected <abp-input>:

  • Render the input/select after GetInfoAsHtml so aria-describedby actually reaches the final HTML.
  • Append (and dedupe) aria-describedby tokens via a new AppendAriaDescribedby helper instead of overwriting caller-supplied values.
  • Use the id directly in AddInfoTextId (no localizer detour).
  • Skip the InfoText id and aria-describedby when the input/select has no id.

Tests cover both <abp-input> and <abp-select>: rendered element, base / caller-preserved / whitespace / no-id / [InputInfoText] cases for 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
Copilot AI review requested due to automatic review settings May 1, 2026 06:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Bootstrap UI rendering for <abp-select> info text to align with <abp-input> and Bootstrap 5 guidance, aiming to improve accessibility by linking the <select> to its description via aria-describedby.

Changes:

  • Render select info text using <div class="form-text"> instead of <small class="form-text">.
  • Attempt to add aria-describedby to the <select> pointing at the info text element id.

maliming added 2 commits May 1, 2026 14:23
- Verify info text is rendered as <div class="form-text"> (not <small>)
- Verify aria-describedby is set on the select tag
…rendering

- Move inputTag.Render after GetInfoAsHtml so aria-describedby reaches the final HTML
- Replace Attributes.Add with Attributes.SetAttribute for aria-describedby to avoid duplicates when [InputInfoText] and info="..." are both present
- Apply the same fixes to AbpInputTagHelperService for consistency
- Cover the [InputInfoText] attribute path with an additional test
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aligns <abp-select>’s rendered info text and accessibility wiring with Bootstrap 5 and <abp-input> by rendering info text as <div class="form-text"> and ensuring the <select> receives aria-describedby pointing at that info text element.

Changes:

  • Render <abp-select> info text using <div class="form-text"> (instead of <small class="form-text">).
  • Ensure aria-describedby is applied before the <select> / <input> is rendered to HTML, and avoid duplicates via SetAttribute(...).
  • Add tests for <abp-select> info rendering + aria-describedby behavior (including the [InputInfoText] path).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/TagHelpers/Form/AbpSelectTagHelperService_Tests.cs Adds coverage for <abp-select> info text markup and aria-describedby behavior.
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs Reorders rendering so aria-describedby is applied before serialization, switches info element to <div>, and uses SetAttribute.
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs Applies the same render ordering and SetAttribute approach for consistency with select changes.

- Stop using the localized text as the aria-describedby value in AddInfoTextId; reference the actual id directly
- Skip rendering the InfoText id and aria-describedby when the input/select has no id (or an empty one) so the form never renders a non-unique "InfoText" id
- Cover the no-id case with a new test
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Bootstrap form tag helpers to align <abp-select> help text markup with Bootstrap 5 guidance and improve accessibility by wiring the help text to the form control via aria-describedby.

Changes:

  • Render <abp-select> info/help text as <div class="form-text"> (instead of <small class="form-text">) and set aria-describedby on the <select>.
  • Fix ordering so Render(...) happens after GetInfoAsHtml(...), ensuring late-added attributes (like aria-describedby) are present in the final HTML.
  • Avoid duplicate aria-describedby attributes by using SetAttribute(...) and add a new unit test suite for <abp-select>.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs Updates info text markup + ensures aria-describedby is applied before rendering.
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs Applies the same render-order and aria-describedby de-duplication approach for consistency.
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/TagHelpers/Form/AbpSelectTagHelperService_Tests.cs Adds coverage for <abp-select> info element type and aria-describedby behavior.

- Add TagHelperOutputExtensions.AppendAriaDescribedby helper that preserves caller-supplied tokens (space-separated id list) and dedupes
- Replace SetAttribute calls in AddInfoTextId/GetInfoAsHtml of abp-input/abp-select with the helper
- Cover the consumer-provided aria-describedby case with a new test
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates ABP Bootstrap form tag helpers to render <abp-select> info text using Bootstrap 5’s recommended markup and to correctly wire aria-describedby so assistive technologies announce the description (aligning behavior with <abp-input> and fixing a few related issues).

Changes:

  • Render <abp-select> info text as <div class="form-text"> and correctly apply aria-describedby before the element is rendered.
  • Fix aria-describedby handling to avoid duplicates and avoid localizing id references; skip wiring when the control has no id.
  • Add AppendAriaDescribedby helper and introduce new unit tests for <abp-select> behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/TagHelpers/Form/AbpSelectTagHelperService_Tests.cs Adds tests validating <div class="form-text"> rendering and aria-describedby behavior (including no-id and no-duplicate scenarios).
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs Updates select rendering order and info text markup; fixes aria-describedby generation and no-id behavior.
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs Applies the same aria-describedby timing/duplication/no-id fixes for consistency with select behavior.
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Extensions/TagHelperOutputExtensions.cs Adds AppendAriaDescribedby helper to safely merge aria-describedby tokens without duplication.

…rService

Cover the new aria-describedby behaviour for <abp-input>:
- form-text rendered as <div>
- aria-describedby reaches the final HTML
- no-id case skips the InfoText id and aria-describedby
- caller-supplied aria-describedby is preserved (append + dedupe)
- [InputInfoText] attribute path produces a single aria-describedby
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aligns <abp-select> info-text rendering with Bootstrap 5 and improves accessibility by ensuring the rendered <select>/<input> elements are correctly wired to their info text via aria-describedby (without duplicates or overwriting caller-provided values).

Changes:

  • Render <abp-select> info text as <div class="form-text"> (instead of <small>) and wire aria-describedby to the info element id.
  • Fix aria-describedby handling in both select/input tag helpers (render order, no-id behavior, preserve existing values, avoid duplicates) via a shared AppendAriaDescribedby helper.
  • Add/extend unit tests covering the new rendering and aria-describedby behaviors for both select and input.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs Delays rendering until after info generation so aria-describedby makes it into output; switches info element to <div class="form-text"> and appends aria-describedby safely.
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs Applies the same render-order and aria-describedby append/no-id logic used for select for consistency and correctness.
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Extensions/TagHelperOutputExtensions.cs Introduces AppendAriaDescribedby to preserve existing values and avoid duplicate tokens.
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/TagHelpers/Form/AbpSelectTagHelperService_Tests.cs Adds new tests validating select info element markup and aria-describedby behavior (including no-id and caller-provided values).
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/TagHelpers/Form/AbpInputTagHelperService_Tests.cs Extends input tests to cover info rendering and aria-describedby behaviors parallel to select.

…tespace

- Look up the existing aria-describedby attribute with OrdinalIgnoreCase to match the casing rules used by HTML and TagHelperAttributeList
- Tokenize the existing value on all ASCII whitespace (space, tab, newline, carriage return, form feed) instead of just the literal space
- Cover the whitespace-separated case with a new test
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aligns <abp-select> (and <abp-input> for consistency) with Bootstrap 5 guidance by rendering info text as <div class="form-text"> and wiring aria-describedby so assistive technologies announce the description. It also fixes ordering/attribute-handling issues so the generated aria-describedby actually reaches the rendered HTML and does not overwrite or duplicate caller-provided values.

Changes:

  • Render info text using <div class="form-text"> and ensure aria-describedby is applied before the input/select is serialized.
  • Add TagHelperOutputExtensions.AppendAriaDescribedby(...) to append/dedupe aria-describedby tokens without overwriting existing values.
  • Add/extend unit tests for <abp-select> and <abp-input> covering the new markup and aria-describedby behaviors (including no-id and no-duplicate scenarios).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs Renders info as <div class="form-text"> and appends aria-describedby before rendering the <select>.
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs Applies the same render-order and aria-describedby handling fixes for <abp-input>.
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Extensions/TagHelperOutputExtensions.cs Introduces AppendAriaDescribedby to preserve/append/dedupe aria-describedby tokens.
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/TagHelpers/Form/AbpSelectTagHelperService_Tests.cs New tests validating <abp-select> info element and aria-describedby behavior.
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/TagHelpers/Form/AbpInputTagHelperService_Tests.cs Additional tests validating <abp-input> info element and aria-describedby behavior.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.57%. Comparing base (dbf3d60) to head (dd3e969).
⚠️ Report is 8 commits behind head on rel-10.2.

Additional details and impacted files
@@             Coverage Diff              @@
##           rel-10.2   #25352      +/-   ##
============================================
- Coverage     49.78%   49.57%   -0.21%     
============================================
  Files          3609     3575      -34     
  Lines        120658   118052    -2606     
  Branches       9215     9040     -175     
============================================
- Hits          60069    58526    -1543     
+ Misses        58794    57766    -1028     
+ Partials       1795     1760      -35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@maliming maliming added this to the 10.2-final milestone May 4, 2026
@maliming maliming requested a review from enisn May 4, 2026 05:54
@enisn enisn merged commit c56f627 into rel-10.2 May 4, 2026
8 of 9 checks passed
@enisn enisn deleted the maliming/abp-select-info-as-div branch May 4, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants