-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
A way to wrap a multiple separate items into one dropdown #5420
Comments
Do you think what we did in the Font Size/Family/Highlight is enough? Should we come up with a generic mechanism to configure dropdowns using the toolbar config (it seems like a very tricky thing, though). |
It's a different kind of feature. We have APIs to wrap things in dropdowns. But it requires building the editor. We need something declarative, which could be done by anyone when integrating an editor. |
Declarative like toolbar API/config? |
Yes ;) Like in the linked comment which started this topic: https://github.com/ckeditor/ckeditor5-heading/issues/74#issuecomment-305224952. |
I'm not sure how could we wrap a couple of items in a drop-down and assign an icon to it, though. We could specify an icon as a string somewhere (in the cfg) but what about importing it? We need an explicit |
An SVG's source can be specified through a config file. Or we'll add support for SVG source paths and it'll be even easier. Besides, you don't need an icon for a normal dropdown. For a dropdown based on a split button we can use icons of buttons that we're wrapping, so that's not a problem either. |
You can check this plugin : https://github.com/Didask/ckeditor5-dropdownui It's an early release: The plugin has two methods to call from the config.
It doesn't create subcommand on the fly, but use command already existing in the build. The name of the dropdown can be seen as a prefix for commands, Implem looks like this :
|
I'm glad it works for you, @long-lazuli. But I'm afraid this kind of approach is a no-go when developers use any default editor build and they have no way to import any internals (classes, helpers) from the build. In other words: I think we should avoid any solution that involves importing/executing code at the I think we could either:
|
I would be really happy to leave this code behind and use your approach :) Btw, I wanted to be able to use a clear syntax without creating instance of dropdown on the fly. {
type: 'dropdown',
title: 'Select image alignment',
icon: alignOptionsIcon,
options: [
'alignLeft',
'alignCenter',
'alignRight'
]
} |
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue. |
We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it). |
As described in https://github.com/ckeditor/ckeditor5-heading/issues/74#issuecomment-305224952.
The goal is to allow wrapping multiple items into one dropdown just by the toolbar configuration (or implementing a super simple plugin or both).
The text was updated successfully, but these errors were encountered: