Skip to content

MudField: AdornmentAria and ShrinkLabel#11669

Merged
danielchalmers merged 5 commits intoMudBlazor:devfrom
versile2:fix/mudfield_7270_5146_7533
Jul 30, 2025
Merged

MudField: AdornmentAria and ShrinkLabel#11669
danielchalmers merged 5 commits intoMudBlazor:devfrom
versile2:fix/mudfield_7270_5146_7533

Conversation

@versile2
Copy link
Contributor

@versile2 versile2 commented Jul 17, 2025

Resolves #7270
Resolves #5146
Resolves #7533
AdornmentAria was missing from MudField, added the property.
Added an override for ShrinkLabel behavior and updated documentation. This does not affect previous behavior, but allows someone using the MudField to force the label into Placeholder position by setting ShrinkLabel to true.
Added unit tests
Updated Documentation:

Screenshot 2025-07-17 013941

Checklist:

  • The PR is submitted to the correct branch (dev).
  • My code follows the style of this project.
  • I've added relevant tests or tested on existing ones.

versile2 added 3 commits July 16, 2025 16:59
Introduced `AdornmentAriaLabel` for better accessibility in the `MudField` component. Added `ShrinkLabel` parameter to control label display behavior. Created `FieldStartAdornmentTest` to validate `mud-shrink` class application. Updated `FieldTests` to include tests for new features and ensure correct field rendering with various adornment configurations.
- Restructured layout in FieldLabelPlaceholderExample.razor.
- Updated ShrinkLabel feature in MudField.
- Updated FieldPage.razor documentation for clarity on ShrinkLabel usage.
- Modified FieldTests.cs to reflect new ShrinkLabel behavior.
- Improved documentation comments for the ShrinkLabel parameter in MudField.razor.cs.
@github-actions github-actions bot added accessibility Accessibility concerns (ARIA, keyboard, focus, screen readers, contrast) enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library labels Jul 17, 2025
@codecov
Copy link

codecov bot commented Jul 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.35%. Comparing base (94ef739) to head (9aefb80).
⚠️ Report is 40 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev   #11669   +/-   ##
=======================================
  Coverage   91.35%   91.35%           
=======================================
  Files         466      466           
  Lines       14697    14702    +5     
  Branches     2853     2853           
=======================================
+ Hits        13426    13431    +5     
  Misses        632      632           
  Partials      639      639           

☔ 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.

@versile2 versile2 requested a review from Copilot July 17, 2025 06:44

This comment was marked as outdated.

@versile2 versile2 requested a review from Copilot July 18, 2025 14:45
Copy link
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 pull request adds two new accessibility and usability features to the MudField component: AdornmentAriaLabel property for screen reader support and ShrinkLabel property for controlling label positioning behavior.

  • Adds AdornmentAriaLabel property to provide aria-label attribute for field adornments
  • Adds ShrinkLabel property to override default label shrinking behavior, allowing labels to remain as placeholders
  • Updates documentation and examples to demonstrate the new ShrinkLabel functionality

Reviewed Changes

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

Show a summary per file
File Description
MudField.razor.cs Adds AdornmentAriaLabel and ShrinkLabel properties with logic to control label positioning
MudField.razor Applies AdornmentAriaLabel to both start and end adornments
FieldTests.cs Adds comprehensive unit tests for both new features
FieldTest.razor Updates test component to verify AdornmentAriaLabel functionality
FieldStartAdornmentTest.razor New test component specifically for ShrinkLabel behavior testing
FieldPage.razor Updates documentation to explain the new ShrinkLabel feature
FieldLabelPlaceholderExample.razor Enhanced example demonstrating ShrinkLabel usage with custom input controls

@sonarqubecloud
Copy link

@danielchalmers danielchalmers merged commit 78a9abf into MudBlazor:dev Jul 30, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility Accessibility concerns (ARIA, keyboard, focus, screen readers, contrast) enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

3 participants