Skip to content

MudInput: Replace AutoGrow with Sizing#12417

Merged
danielchalmers merged 19 commits intoMudBlazor:devfrom
danielchalmers:input-sizing-enum
Jan 14, 2026
Merged

MudInput: Replace AutoGrow with Sizing#12417
danielchalmers merged 19 commits intoMudBlazor:devfrom
danielchalmers:input-sizing-enum

Conversation

@danielchalmers
Copy link
Copy Markdown
Member

@danielchalmers danielchalmers commented Jan 12, 2026

Preparation for #8687

This pull request refactors and enhances the multiline and auto-growing text field functionality in MudBlazor. The main change is the replacement of the AutoGrow property with a more flexible Sizing property, allowing explicit control between fixed and auto-sizing behavior. The documentation and tests have been updated to reflect this new approach, and new test components have been added to demonstrate and validate the changes.

/// <summary>
/// The strategy for how the input calculates its height.
/// </summary>
public enum InputSizing
{
    /// <summary>
    /// The height is fixed based on the Lines property.
    /// </summary>
    [Description("fixed")]
    Fixed,

    /// <summary>
    /// The height grows and shrinks dynamically to fit the text content.
    /// Uses Lines as minimum and MaxLines as maximum.
    /// </summary>
    /// <remarks>
    /// Previously known as "AutoGrow".
    /// </remarks>
    [Description("auto")]
    Auto,
}

Checklist:

  • I've read the contribution guidelines
  • My code follows the style of this project
  • I've added or updated relevant unit tests

### Key Features:
- **Backward Compatible**: `AutoGrow=true` still works via `GetEffectiveSizing()`
- **Fill Mode**: New `InputSizing.Fill` allows inputs to fill available container space (ideal for note-taking apps in dialogs)
- **All 112 TextField tests pass**
@mudbot mudbot bot added the enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library label Jan 12, 2026
@danielchalmers danielchalmers changed the title Add input sizing MudInput: Replace AutoGrow with InputSizing Jan 12, 2026
@danielchalmers danielchalmers added the breaking change This change will require consumer code updates (ex: removes/changes a public API) label Jan 12, 2026
@danielchalmers danielchalmers changed the title MudInput: Replace AutoGrow with InputSizing MudInput: Replace AutoGrow with Sizing, Add InputSizing.Fill Jan 12, 2026
@danielchalmers danielchalmers changed the title MudInput: Replace AutoGrow with Sizing, Add InputSizing.Fill MudInput: Replace AutoGrow with Sizing Jan 14, 2026
@danielchalmers danielchalmers marked this pull request as ready for review January 14, 2026 03:05
@danielchalmers danielchalmers removed the enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library label Jan 14, 2026
@danielchalmers danielchalmers merged commit 79b45c3 into MudBlazor:dev Jan 14, 2026
6 checks passed
@danielchalmers danielchalmers deleted the input-sizing-enum branch January 14, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change This change will require consumer code updates (ex: removes/changes a public API)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant