Skip to content

tinymce.get() function doesn't appear to work in version 6.0.2 for the Web Component API #32

Open
@bob2517-whiteline

Description

What is the current behavior? Describe the bug
The tinymce.get() function doesn't appear to work for the Web Component API.

Please provide the steps to reproduce and if possible a minimal demo of the problem via fiddle.tiny.cloud or similar.

// Several editors are on the page at this point.
// The specific one mentioned below is displayed correctly on the page when the code below runs.
// The editor that is being retrieved is not the active instance.

// This ID is set on the tinymce-editor tag. On the <tinymce-editor> tag itself.
let thisTinyMCEEditor = 'oneOfSeveralEditors_1';

let el = document.getElementById(thisTinyMCEEditor);
// Correctly displays a tinymce-editor element:
console.log('el:', el);

let activeEditor = tinymce.get(thisTinyMCEEditor);
// Incorrectly displays "null":
console.log('activeEditor:', activeEditor);

What is the expected behavior?
The editor specified by the ID should be retrieved by the get() function.

Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE?
At least version 6.0.2. I didn't see any mentioned fix for this in later versions.
Affects Chromium/Firefox.

Suggestion: is it trying to look in the shadow DOM for the tag?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions