Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 2, 2025

The Gutters property on MudExpansionPanel only controlled content padding, not header padding. Setting Gutters="false" left the header with fixed 24px horizontal padding.

<!-- Before: header still had 24px padding -->
<MudExpansionPanel Text="Title" Gutters="false">
    Content
</MudExpansionPanel>

<!-- After: both header and content respect Gutters -->
<MudExpansionPanel Text="Title" Gutters="false">
    Content  <!-- Now both have 0px horizontal padding -->
</MudExpansionPanel>

Changes

SCSS (_expansionpanel.scss)

  • Changed .mud-expand-panel-header base padding from 16px 24px to 16px 0px
  • Added .mud-expand-panel-header-gutters modifier that applies padding-left: 24px; padding-right: 24px

C# (MudExpansionPanel.razor.cs)

  • Applied gutters class to header using same logic as content: Gutters && Parent?.Gutters != false

Tests

  • Added 3 test scenarios: Gutters=true, Gutters=false, and parent override

Documentation (ExpansionPanelPaddingExample.razor)

  • Enhanced the Padding example to clearly showcase all Gutters behaviors with descriptive sections:
    • Default Gutters=true behavior
    • No Gutters (Gutters=false) - highlighting the fix
    • Dense panel variations with and without gutters
    • Parent-level Gutters inheritance

Enhanced Padding Example

Default behavior (Gutters=true) unchanged - only fixes the broken Gutters=false case.

Original prompt

This section details on the original issue you should resolve

<issue_title>MudExpansionPanel Gutters property has no effect when set to false</issue_title>
<issue_description>### Things to check

  • I have searched the existing issues for this bug
  • To rule out a caching problem I made sure the bug also happens in an incognito tab

Bug type

Component

Component name

MudExpansionPanel

What happened?

Gutters on MudExpansionPanel do not work when set to false, it keeps padding from left and right.

Expected behavior

Gutters when set to false to remove padding from left and right

Reproduction link

https://try.mudblazor.com/snippet/mkwpEclNpxnzWPvt

Reproduction steps

/

Relevant log output

Version (bug)

8.2.0

Version (working)

6.x.x

What browsers are you seeing the problem on?

Edge

On which operating systems are you experiencing the issue?

Windows

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct</issue_description>

<agent_instructions>Make the behavior consistent and expected according to the docs or other sources</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 2, 2025
…tent padding

Co-authored-by: danielchalmers <7112040+danielchalmers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix gutters property issue in MudExpansionPanel ExpansionPanel: Fix Gutters property not affecting header padding Nov 2, 2025
Copilot AI requested a review from danielchalmers November 2, 2025 15:24
Copilot finished work on behalf of danielchalmers November 2, 2025 15:24
@danielchalmers danielchalmers changed the title ExpansionPanel: Fix Gutters property not affecting header padding MudExpansionPanel: Fix Gutters property not affecting header padding Nov 2, 2025
@danielchalmers
Copy link
Member

@copilot Update the Padding example in the docs to showcase this

@mudbot mudbot bot added bug Unexpected behavior or functionality not working as intended docs Web or code documentation or examples is the main focus needs: changes A maintainer has asked for further modifications to be made before this pull request can be approved tests Tests or test infrastructure is the main focus labels Nov 2, 2025
Co-authored-by: danielchalmers <7112040+danielchalmers@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 2, 2025

@copilot Update the Padding example in the docs to showcase this

Updated the Padding example with clear sections demonstrating:

  • Default Gutters=true behavior
  • Gutters=false (highlighting the fix)
  • Dense panel variations
  • Parent-level Gutters inheritance

Commit: f161428

Enhanced Padding Example

The example now clearly shows how both header and content respect the Gutters property, with a highlighted section explaining the fix.

Copilot finished work on behalf of danielchalmers November 2, 2025 15:40
@danielchalmers
Copy link
Member

Before (https://try.mudblazor.com/snippet/wkwplbEcTqqWygpF)

image

After (docs on this build)

image

@danielchalmers danielchalmers marked this pull request as ready for review November 2, 2025 15:46
@mudbot mudbot bot removed the needs: changes A maintainer has asked for further modifications to be made before this pull request can be approved label Nov 2, 2025
@icistrate
Copy link

icistrate commented Nov 9, 2025

@danielchalmers
Something looks to be strange here. I have no Gutters set anywhere (which should imply they are true by default), so horizontal padding should be applied to the header, but I cannot see it applied. I see it applied to the content though.

Razor code:

<MudExpansionPanels Class="mt-4" MultiExpansion="true" Elevation="1">
    @foreach (var group in ...)
    {
        <MudExpansionPanel Class="mb-2" Expanded="true" HideIcon="true">
            <TitleContent>
               <MudText Typo="Typo.h5" Color="Color.Secondary">@group.GroupName</MudText>
            </TitleContent>
            <ChildContent>
                  ...
            </ChildContent>
        </MudExpansionPanel>
     }
</MudExpansionPanels>

Picture when inspecting header:
image

Picture when inspecting content:
image

@danielchalmers
Copy link
Member

@icistrate Thanks for the heads up! Would you be able to create an issue for this with reproduction and ping me so I can take a further look?

@icistrate
Copy link

@danielchalmers Thanks for the message. Very strange, I started to extract it into a simpler example and now I see correct behaviour. So, I guess it is something with the whole setup in my application. I cannot seem to figure it out for the moment. If I manage to reproduce outside, I will create an issue. Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MudExpansionPanel Gutters property has no effect when set to false

3 participants