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

290
Visualizações
How to set a character limit for the raw data output in ckeditor 5

I have a max length that I need editor.getData().length to be before I send it to my server. I have the word Count plugin working I just need to add some code to achieve this in the on update method. I want the editor to behave as an html input tag would behave with the "maxlength" attribute set, so it would disable any further typing when the dataCount reaches the specified limit(5000).

ClassicEditor
    .create( document.querySelector( '#editor' ),{
        
    })
    .then( editor => {      
        editor.plugins.get( 'WordCount' ).on( 'update', ( evt, stats ) => {
            const limit = 5000;
            const dataCount = editor.getData().length;
            //disable typing when dataCount >= limit
            //what code do I put here?   
        } );                                
    } )             
    .catch( error => {
        console.error( 'Oops, something went wrong!' );             
        console.error( error );
    } );
about 4 years ago · Santiago Gelvez
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