Skip to content

feat: add password input type support for MudBlazor text fields#86

Merged
phmatray merged 1 commit intomainfrom
feat/55-password-mask
Feb 26, 2026
Merged

feat: add password input type support for MudBlazor text fields#86
phmatray merged 1 commit intomainfrom
feat/55-password-mask

Conversation

@phmatray
Copy link
Owner

Summary

  • Fix WithInputType("password") not rendering as a password field in MudBlazor — the RenderTextField method in FormCraftComponent now passes the InputType from field configuration to MudTextField, mapping string values to MudBlazor's InputType enum
  • Update AddPasswordField convenience method to automatically set WithInputType("password") so password fields are masked by default
  • Add adornment attribute passthrough support for future show/hide toggle icons

Changes

  • FormCraftComponent.razor.cs — Added InputType mapping in RenderTextField (with GetInputType helper method that maps password, email, tel, url, search to MudBlazor enums), plus Adornment/AdornmentIcon attribute passthrough
  • FluentFormBuilderExtensions.cs — Added .WithInputType("password") call inside AddPasswordField
  • FieldBuilderTests.cs — Added 2 new tests for WithInputType (password and email)
  • FluentFormBuilderExtensionsTests.cs — Updated existing password test to assert InputType is set

Testing

  • All 555 existing tests pass
  • 2 new unit tests verify WithInputType sets the correct value on field configuration
  • Existing AddPasswordField test updated to verify InputType is "password"

Fixes #55

@phmatray phmatray merged commit 7d07fc8 into main Feb 26, 2026
1 check passed
@phmatray phmatray deleted the feat/55-password-mask branch February 26, 2026 23:00
@phmatray phmatray mentioned this pull request Feb 26, 2026
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.

Password mask

1 participant