Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync problems when focus is called #31

Closed
jcamejo opened this issue Jun 14, 2019 · 1 comment
Closed

Sync problems when focus is called #31

jcamejo opened this issue Jun 14, 2019 · 1 comment

Comments

@jcamejo
Copy link

jcamejo commented Jun 14, 2019

Hi!

i am adapting the plugin, it's working great so far. The only issue i'm having is that when the ckeditor is invoked by any component that requires it, the cursor is not inserted inside the element that is going to be edited.

My suspicion is that the focus action of the rte object is being fired before the instance is completely ready but i'm not 100% sure. The workaround for this issue was delaying the call of the focus action of the ckeditor object.

focus(el, rte) {
      // Do nothing if already focused
      if (rte && rte.focusManager.hasFocus) {
        return;
      }
      el.contentEditable = true;
      if(rte) {
	setTimeout(function() {
	rte.focus();
	}, 500);
      }
    }

This is a hackish solution but i'm not sure how to deal with this situation, maybe there's a hook or listener where i can verify if the instance is ready to fire the focus action. I would gladly propose a pull request if there's something within the plugin range to fix this. It could be that this goes more into the Ckeditor territory.

Cheers!

yanfanvip added a commit to yanfanvip/grapesjs-plugin-ckeditor that referenced this issue Nov 6, 2021
@artf
Copy link
Member

artf commented Jun 6, 2023

Should be fixed in the latest release

@artf artf closed this as completed Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants