Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

207
Vistas
Tiptap editor framework: what is the difference between set and toggle functions?

I've been playing around with the tiptap editor framework for a few days now, and I have trouble understanding what is the difference between set and toggle functions. As an example, what is the difference between the setBold() function and the toggleBold() (https://tiptap.dev/api/marks/bold).

Thanks!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In general "toggle" means switch back-and-forth between on and off

So if you know you definitely want to switch bolding ON, use .setBold()

If you definitely want to switch bolding OFF, use .unsetBold()

And if you just want to reverse the bolding state, use .toggleBold()

Why you may have found it difficult to see the difference

If you tried both, and found identical effects, probably you were testing from a state of "not bolded".

If you try the two functions on a piece of text that is already bold, you will see that "toggle" turns off the bold, and "set" leaves the text remaining bold.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda