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

174
Views
¿Cómo cambiar la configuración de react-mui-draft-wysiwyg?

Uso el material del editor HTML ui:

 import MUIEditor, { MUIEditorState } from "react-mui-draft-wysiwyg"; <MUIEditor editorState={formElement.editorState} onChange={formElement.onChange} />

Quiero eliminar el botón de color de fuente en la barra de herramientas. Cuando voy al archivo MUIEditor en node-modules y quiero hacer algunos cambios en ese archivo, pero parece que no cambia incluso cuando obtengo una consola, no puedo ver el resultado. ¿Qué tengo que hacer?

 .node_modules .react-mui-draft-wysiwyg .dist .index.js
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Rara vez es aconsejable editar el contenido de /node_modules ; en su lugar, react-mui-draft-wysiwyg proporciona una forma directa de personalizar la configuración de la barra de herramientas a través del accesorio de config , en su propio código React.

En su caso, para ocultar el botón de color de fuente, simplemente necesita pasar las opciones de menú que le gustaría mostrar. (es decir, eliminar/comentar la opción toolbarControlTypes.fontColor ). Por ejemplo:

 import MUIEditor, { MUIEditorState, toolbarControlTypes // Added toolbarControlTypes } from "react-mui-draft-wysiwyg"; ... <MUIEditor editorState={editorState} onChange={onChange} config={{ toolbar: { controls: [ toolbarControlTypes.undo, toolbarControlTypes.redo, toolbarControlTypes.divider, toolbarControlTypes.bold, toolbarControlTypes.italic, toolbarControlTypes.underline, toolbarControlTypes.strikethrough, // Include all of the default toolbar options except for fontColor // toolbarControlTypes.fontColor, toolbarControlTypes.fontBackgroundColor, toolbarControlTypes.divider, toolbarControlTypes.linkAdd, toolbarControlTypes.linkRemove, toolbarControlTypes.image, toolbarControlTypes.divider, toolbarControlTypes.blockType, toolbarControlTypes.fontSize, toolbarControlTypes.fontFamily, toolbarControlTypes.textAlign, toolbarControlTypes.divider, toolbarControlTypes.unorderedList, toolbarControlTypes.orderedList ] } }} />

Documentación: Opciones de configuración predeterminadas

Código de trabajo Sandbox:https://codesandbox.io/s/mui4-draft-wysiwyg-bre8e?file=/demo.js

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!