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

107
Vistas
tinyMCE v6 event bubbling

I trying to catch keydown triggered on < p > element inside of editor iFrame but with this code, i getting textarea element. Event.stopPropagation() does not stop bubbling, i still getting topmost element

tinymce.init({
   selector: 'textarea',
   setup:function(editor) {
      editor.on('keydown', function(event) {
         console.log(event.target);
      });
   }
});

I see tinymce.event in API with its own stopPropagation() method but don't get how to make it work. Tinymce.event return undefined same as editor.event or tinymce.Event.type

also, there is eventDispatcher Utility API but trying to process keydown via eventDispatcher.dispatch() triggered inside of editor.on keydown get me nothing

In the end, I tried to remove class/style from a block inside of the editor. And cause this block is added programmatically I cant do this with the class name. I need an element pointer where is keydown happened

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

0

Find out that I can use tinyMCE selection helper to get an element with current focus (which triggered an event) and solve my task

So the final code is

tinymce.init({
    selector: 'textarea',
    setup:function(editor) {
       editor.on('keydown', function(event) {
           const element = editor.selection.getNode();
    
           if (editor.dom.hasClass(element, 'classname')) {
    
           }  
       }
});
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