-
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
Image upload toolbar bug #4093
Comments
Up this issue |
Maybe use another library ? #Joke |
I encountered the same issue: When clicking the image button in the toolbar:
Here's a video illustrating the issue (comparing https://quilljs.com vs https://v1.quilljs.com): 2024-04-17.Quill.v1.vs.v2.image.uploading.mp4How to revert this behavior? |
Related pull request ("image selector fix"): #4120 |
Summarizing the fix suggested in https://github.com/quilljs/quill/pull/4120/files: Current codeSuggested fix by @medi6 #4120
Result // Special case toolbar shorthand
if (
options.modules != null &&
options.modules.toolbar &&
options.modules.toolbar.constructor !== Object
) {
options.modules.toolbar = {
container: options.modules.toolbar,
};
}
const modules: ExpandedQuillOptions['modules'] = merge(
{},
expandModuleConfig(quillModuleDefaults),
expandModuleConfig(themeModuleDefaults),
expandModuleConfig(options.modules),
); NoteIn the PR, @medi6 also cloned |
Hi @anisabboud , you can fix this by code in your app, also, but it' a temporary solution, waiting for a new release. // fix temporaire pour les handlers
if (this.quillEditor?.theme.modules.toolbar && this.quillEditor?.options.theme) {
if (this.quillEditor?.theme.modules.toolbar.handlers) {
Object.keys( (<Toolbar>(<Quill>this.quillEditor).options.theme.DEFAULTS.modules.toolbar).handlers).forEach(format => {
const handler = (<Toolbar>(<Quill>this.quillEditor).options.theme.DEFAULTS.modules.toolbar).handlers?.[format];
if (handler) {
(<Toolbar>(<Quill>this.quillEditor).theme.modules.toolbar).addHandler(format, handler);
}
});
}
} |
Closing with #4120 |
The problem seems to be only present in version 2.0.0-rc.2 but not in 1.3.7.
When I click on upload image button, instead of the file explorer, QuillJS opens the same popup as the link upload.
Steps for Reproduction
Expected behavior:
When clicking on the upload image button in the toolbar, the file explorer pop-up should appear.
Actual behavior:
The link upload pop-up appears
Platforms:
Tested on Edge, Chrome and Mozilla
Each time, the QuillJS upload image button in the toolbar doesn't work in v 2.0.0-rc.2
Version: 2.0.0-rc.2
I don't need to paste some of my code, since this behaviour is happening on the QuillJS website directly.
Does someone has a solution?
The text was updated successfully, but these errors were encountered: