Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MudInputControl: Fix nested <div> inside <p> #8871

Merged
merged 1 commit into from
May 8, 2024

Conversation

truongdatnhan
Copy link
Contributor

@truongdatnhan truongdatnhan commented May 4, 2024

Description

We cannot nest <div> inside <p>.

The problem appears in SSR non-interactive mode. When the server send new page, DOM will refuse to nest <div> inside <p> #8855 .

<span> is an inline element, It will allow <div> nesting.
I have compared the two styles visually and computed values after changing them.

How Has This Been Tested?

visually

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

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

@github-actions github-actions bot added bug Something does not work as intended/expected PR: needs review labels May 4, 2024
Copy link

codecov bot commented May 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.14%. Comparing base (28bc599) to head (51a14b4).
Report is 139 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8871      +/-   ##
==========================================
+ Coverage   89.82%   90.14%   +0.31%     
==========================================
  Files         412      421       +9     
  Lines       11878    12304     +426     
  Branches     2364     2431      +67     
==========================================
+ Hits        10670    11091     +421     
+ Misses        681      665      -16     
- Partials      527      548      +21     

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

Copy link
Contributor

@danielchalmers danielchalmers left a comment

Choose a reason for hiding this comment

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

Makes sense.

Open question: Do we even need that much nesting to begin with? Can @HelperClass be added to the d-flex div and delete the span, or all three be merged into one div? Not good to have so many DOM elements.

@henon
Copy link
Collaborator

henon commented May 4, 2024

Makes sense.

Open question: Do we even need that much nesting to begin with? Can @HelperClass be added to the d-flex div and delete the span, or all three be merged into one div? Not good to have so many DOM elements.

@Garderoben I think you made it that way. What do you say about merging the dom elements?

@danielchalmers
Copy link
Contributor

danielchalmers commented May 8, 2024

I think you made it that way. What do you say about merging the dom elements?

@henon let's just merge it with the nesting. can see what he thinks about it in the future when he has free time because it's going to be a widespread thing anyway

@henon henon merged commit 0013967 into MudBlazor:dev May 8, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants