Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

542
Views
Cómo cambiar el color del texto del campo de texto MUI deshabilitado | MUI v5?

Quiero modificar el color de fuente de MUI TextField deshabilitado. Debe ser negro para que sea visible.

Aquí está el código

 <TextField fullWidth variant="standard" size="small" id="id" name="name" type="text" InputProps={{disableUnderline: true}} disabled={true} />

Eliminé el subrayado para el campo de texto estándar. Ahora quiero el color de texto negro cuando está deshabilitado.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Inspirado en la solución de Madhuri, también puede usar el accesorio sx sin importar el estilo:

 <TextField fullWidth variant="standard" size="small" id="id" name="name" type="text" InputProps={{disableUnderline: true}} disabled={true} sx={{ "& .MuiInputBase-input.Mui-disabled": { WebkitTextFillColor: "black", }, }} />
about 4 years ago · Juan Pablo Isaza Report

0

Debe usar la clase ".Mui-disabled" para anular el css requerido como se muestra a continuación,

 import TextField from "@mui/material/TextField"; import { styled } from "@mui/material/styles"; const CustomDisableInput = styled(TextField)(() => ({ ".MuiInputBase-input.Mui-disabled": { WebkitTextFillColor: "#000", color: "#000" } })); function App() { return ( <> <span>Disabled Input:</span> <CustomDisableInput fullWidth variant="standard" size="small" id="id" name="name" type="text" value="your text" InputProps={{ disableUnderline: true }} disabled={true} /> </> ); }

Consulte la demostración aquí: https://codesandbox.io/s/mui-customdisableinput-xl7wv

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!