richardwhitney
richardwhitney

Reputation: 532

Quill Editor cursor positions itself behind the first letter

This is not a question, but something I just ran into using the Quill editor, and thought I would share just in case anyone else runs into the same problem.

if you have encountered, when typing, the cursor positions itself behind the first letter, I have a fix - in jquery.

$('.quill').each((i, q) => {
  new Quill(q, {
    modules: {
  toolbar: toolbarOptions
},
theme: 'snow',
placeholder: 'Type here...',
  });  
}).on('focus', (e) => {
  $(this).text($(this).text().substring($(this).text().length, -1));// this is what does it
});

I'm sure you can adapt it to React, Angular or Vue

Upvotes: 0

Views: 103

Answers (1)

Lyubomir Stoyanov
Lyubomir Stoyanov

Reputation: 1

I came across the same issue and I found what the problem was.

.ql-editor > * { 
  cursor: text;
}

This is the default css style of quill, I just changed it to my custom code:

.ql-editor > * { 
  cursor: initial !important;
}

The cursor started working normal again, hope this helps :)

Upvotes: 0

Related Questions