I'm currently using the bubble theme so the toolbar appears when I highlight some text in the editor. Does quill allow another toolbar so that when the user is on a new line, the toolbar appears as well (without highlighting text)?
And within an editor, how can I check if the cursor is on a new line? When I use getSelection, the index is relative to the entire editor rather than the index of each line.
Github issues are for bugs. Please ask questions on StackOverflow.
Please don't mix multiple subjects on the same issue.
I don't think multiple toolbars for the same editor makes sense.
To check if the cursor is on a new line you can check if the char in selectionIndex-1 == "\n"
Something like this (untested):
checkNewLine() {
var range = quill.getSelection();
if(range.index == 0) {
return true;
}
var delta = quill.getContents(range.index-1, 1);
var op = delta.ops[0];
return op.insert && op.insert == "\n";
}
i think that multiple toolbars for the Editor really makes sense since you have done a custom tooltip using the toolbar container and his actions and behaviours, and you like to have ALSO a toolbar.
+1
Same use case, we're displaying a contextual toolbar on selection of text and another static toolbar.
Most helpful comment
+1
Same use case, we're displaying a contextual toolbar on selection of text and another static toolbar.