• I added tinyMCE editor via wp_editor() to post metabox.
    I want the focus inside the editor to be maintained when i switch between the visaul and text tab. (same as post editor)

    For now, when I drag a specific sentence from the visual tab and move to the text tab, the focus disappears.

    If anyone knows a solution please let me know.

    I am using wp version 4.9.20.
    Here is my wp_editor() usage.

    $meta_key = '_my_meta_key';
    $meta_value = get_post_meta($post->ID, $meta_key, true);
    $settings = array(
        'textarea_name' => $meta_key,
        'media_buttons' => false,
    );
    wp_editor($meta_value, 'my_custom_editor', $settings);
    • This topic was modified 2 years, 8 months ago by hjlee012.
    • This topic was modified 2 years, 8 months ago by hjlee012.
Viewing 1 replies (of 1 total)
  • Hi there,
    Have you found a solution yet?

    You could try using the tinymce.FocusManager class.

    This class is needed since some browsers fire false focus/blur states when the selection is moved to a UI dialog or similar. Here’s a link to the docs.

    Hope this helps
    -Jamie

Viewing 1 replies (of 1 total)
  • The topic ‘how to show focus in wp_editor of metabox’ is closed to new replies.