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

[TextField][material-ui] Standard variant styles rendering incorrectly in Next.js app dir #39157

Closed
2 tasks done
Matt-roki opened this issue Sep 25, 2023 · 7 comments
Closed
2 tasks done
Assignees
Labels
component: text field This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature nextjs package: material-ui Specific to @mui/material

Comments

@Matt-roki
Copy link

Matt-roki commented Sep 25, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example: https://codesandbox.io/p/github/mj12albert/nextjs-rsc-standard-textfield/main?file=%2Fsrc%2Fapp%2Fpage.tsx%3A7%2C1

  1. Disable JS
  2. Observe the style tags being rendered inside the component

Screenshot 2023-10-03 at 5 34 02 PM

On initial load the textfield standard has the border half way through the input.

<TextField id="standard-basic" label="Standard" variant="standard" />

On load:

Screenshot 2023-09-25 at 18 44 08

After load:

Screenshot 2023-09-25 at 18 44 20

This is the full code of the component

import { TextField } from '@mui/material' const ContactForm = () => { return( <section > <TextField id="standard-basic" label="Standard" variant="standard" /> </section> ) } export default ContactForm

Current behavior 😯

No response

Expected behavior 🤔

No response

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Im using nextjs 13.5.2 with the latest version of MUI

Screenshot 2023-09-25 at 18 42 16
@Matt-roki Matt-roki added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 25, 2023
@danilo-leal danilo-leal changed the title TextField standard input not loading correctly. [material-ui][Text Field] Standard input not loading correctly Sep 25, 2023
@danilo-leal danilo-leal added component: text field This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material labels Sep 25, 2023
@NmN03jain
Copy link

i want to work on this issue

NmN03jain added a commit to NmN03jain/material-ui that referenced this issue Oct 1, 2023
NmN03jain added a commit to NmN03jain/material-ui that referenced this issue Oct 1, 2023
@mj12albert mj12albert changed the title [material-ui][Text Field] Standard input not loading correctly [TextField][material-ui] Standard variant styles rendering incorrectly Oct 3, 2023
@mj12albert mj12albert changed the title [TextField][material-ui] Standard variant styles rendering incorrectly [TextField][material-ui] Standard variant styles rendering incorrectly in Next.js app dir Oct 3, 2023
@mj12albert mj12albert removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 3, 2023
@mj12albert
Copy link
Member

mj12albert commented Oct 3, 2023

Screenshot 2023-10-03 at 5 34 02 PM

The root cause is that on the server style tags are rendered inside the markup which conflicts with this particular style

'label + &': {
  marginTop: 16,
},

It could be possible to use a different CSS selector that could handle this edge case, are you interested in investigating this further? @NmN03jain

@NmN03jain
Copy link

NmN03jain commented Oct 3, 2023

@mj12albert Ok I'll try

@mj12albert
Copy link
Member

mj12albert commented Oct 3, 2023

Thanks 🙌 I've assigned it to you, let us know if you need any help, e.g. with tests or the CI @NmN03jain

PS: be sure to read the contributing guide ~

@mj12albert
Copy link
Member

@Matt-roki Thanks for reporting this btw ~ I've updated the repro in the description

@mj12albert mj12albert added the enhancement This is not a bug, nor a new feature label Oct 3, 2023
@NmN03jain
Copy link

ci/circleci: test_static
ci/circleci: test_types
@mj12albert how to i resolve this issues

@siriwatknp
Copy link
Member

I think this can be closed by the new integration package @mui/material-nextjs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: text field This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature nextjs package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants