Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

144
Views
TinyMCE v5 custom toggle button in React

I'm trying to implement inside tinymce in React a custom button, that should toggle icon and li tag.

I've tried this :

 <Editor
  apiKey={editorApiKey}
  onInit={(evt, editor) => editorRef.current = editor}
.
.
.

editor.ui.registry.addToggleButton('CustomNoneListButton', {
  text: 'My action',
  onAction() {
    editor.execCommand('InsertUnorderedList', false, {
      'list-style-type': 'none'
    });
  },
  active: true,
  onSetup: (api) => {
    const editorEventCallback = (eventApi) => {
      api.setActive(eventApi.element.nodeName.toLowerCase() === 'li');
    };

    editor.on('NodeChange', editorEventCallback);

    return () => {
      editor.off('NodeChange', editorEventCallback);
    };
  }
});

But it doesn't work, Any idea how can I do that?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!