-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Show Bubble theme toolbar on single click #1120
Comments
I'm not sure the insert image button inside the Bubble tooltip is a good user experience for the reason you mentioned. The problem with opening on click is users typically click around while reading and the persistent tooltip would be very annoying. I would suggest adding external UI like Medium does for inserting images. |
Old and closed topic, but thought I'd share my two cents. Though I agree a single left click can be a strange UI, I feel a single right-click would be a good UI for a such a think... That said this is the solution I came up with. There might be a better one for doing the same thing, but I'm still pretty new to Quill...
I found |
Thanks for the solution @mauteri, how to make editor show the selected formats? |
Thank you @mauteri helped me a lot, one thing to note, when the editor is empty and you try to add a link without any selected text things go weird! the placeholder persists and console shows errors, in addition to your solution we should add a custom handler for handlers: {
link: value => {
// Prevent links format when no text is selected
let range = this.quill.getSelection();
if(!range || range.length == 0){
return;
}
if (!value) {
this.quill.format("link", false);
} else {
this.quill.theme.tooltip.edit();
}
}
} |
The Bubble theme can be extended to achieve the single click behaviour. Here is how I have implemented it. const BubbleTheme = Quill.import('themes/bubble');
class ExtendBubbleTheme extends BubbleTheme {
constructor(quill, options) {
super(quill, options);
quill.on('selection-change', range => {
if (range) {
quill.theme.tooltip.show();
quill.theme.tooltip.position(quill.getBounds(range));
}
});
}
}
Quill.register('themes/bubble', ExtendBubbleTheme); |
For the user to see the Bubble theme toolbar he has to select text first.
However, to insert an image and to 'turn on' bold or italic writing there is no need to select text.
So, I think, it would be nice to have an option to let the toolbar show on a single click in the editor area.
The text was updated successfully, but these errors were encountered: