Hi,
When an embed (formula for instance) is the last blot in a line, the cursor is positioned in the end of the line (in the edge of the editor), instead of just to the right of the embed.
Steps for Reproduction
Expected behavior:
It should put the cursor just after the embed (formula).
Platforms:
Chrome 55.0.2883.75 (OSX)
Safari 10.0 (OSX)
Version:
Quill 1.1.6
Same happening with me. I got a custom embeded and the cursor goes to the end of the line
don't mind the react render
class Placeholder extends Embed {
static blotName = 'chip'
static tagName = 'span'
static className = 'placeholder'
static create (value) {
const node = super.create(value)
node.setAttribute('contentEditable', false)
render(<Chip label={value}/>, node)
return node
}
static value (node) {
const chip = node.querySelector('.md-chip-text')
if (!chip) return null
return chip.innerHTML
}
}
I actually "solved" by inserting a blank space everytime the embeded is inserted
handleChipClick = (text) => {
const {index} = quill.getSelection() || {index: 0}
quill.insertEmbed(index, 'chip', text, Quill.sources.USER)
quill.insertText(index + 1, ' ', Quill.sources.SILENT)
}
+1
This has been fixed in 1.3.0.
Most helpful comment
Same happening with me. I got a custom embeded and the cursor goes to the end of the line

don't mind the react render
I actually "solved" by inserting a blank space everytime the embeded is inserted