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

106
Visualizações
Get the edited content in tinyMCE 6

I am integrating TinyMCE in my ember.js app. Unfortunately I cannot get back the edited content, or at least, all of it.

    tinymce.init({
      selector: '#'+ this.editorId,
      toolbar: 'undo redo | alignleft aligncenter alignright alignjustify | ' ,
      menubar: false,
      setup: (editor) => {
        editor.on('input', (e) => {
          console.log(e);
        });
      }
    });

the input event is fired every time the content is modified. e contain at best, the last div in the editor and never the whole content in e.rangeParent.textContent.

Is there a way to get back all of the content edited by TinyMCE?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I managed to find a way to do it, I changed the method to initialize tinyMCE from selector to target but it should be easy to use for both method.

  const editors= await tinymce.init({
    target: element //the textarea DOM element
  })
  editors[0].on('input',() => {
    setValue(editors[0].getContent())
  })

It may be a little overkill but I have a case where I want to show live the changes in 2 previews at once.

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