Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

210
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda