-
-
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
Add Scroll in dropdown list of a toolbar option ? #952
Comments
Why so small height? There's plenty of space in the viewport (usually). I think that the point of limiting the height was that if the number of options is too big the height of the panel exceeds the height of the viewport.
BTW, remember that panels with scroll work terribly so we wanted to avoid them. The issue is that you can't capture the scroll event in them (easily) so the entire page starts to scroll.
|
Like @Reinmar I would go with something really long (at least 400px), even Google is trying to avoid "double scroll" issue with soooo long dropdowns. I was thinking about using Viewport units, I mean - .ck.ck-dropdown__panel {
max-height: 90vh;
overflow-y: auto;
} |
That is something that could be handled by a CSS custom-property for me. .ck.ck-dropdown__panel {
max-height: 60vh;
max-height: var(--ck-editor-dropdown-max-height, 60vh);
overflow-y: auto;
} and in the dropdown plugin, or in theme plugin, I don't know : ...
init(){
const editorHeight = editor.element.nextElementSibling.clientHeight
editor.element.style.setProperty('--ck-editor-dropdown-max-height', `${editorHeight}px`)
...
}
... |
@long-lazuli CSS Variables is a really good idea to handle that and let users eaisly customize the height of dropdown. Anyways your JS snippet might be buggy, because |
@dkonopka Can you propose some PR? |
@dkonopka , my code is a pseudo-code to give a direction. It's not intended be pasted somewhere. But it could be better to use something like
then, you can ( I don't know if viewport height and width should be calculated in the dropdown function. maybe somewhere more generic; as we should avoid adding scroll/resize listeners in every plugins... ) |
Fix: The `DropdownPanelView` should scroll when the content is long. Added a CSS custom property to control the height of the panel. Closes ckeditor/ckeditor5#952.
We went with the KISS approach (custom property + |
Because of https://github.com/ckeditor/ckeditor5-theme-lark/issues/191 we need to revert change with maximum height and overflow of At this moment there is no way to fix it, firstly we need to use |
Revert: The `DropdownPanelView` should scroll when the content is long. Added a CSS custom property to control the height of the panel (see ckeditor/ckeditor5#952).
Hi. Two months later, do we have a resolution for this? |
i have same issue in ckeditor scroll bar and i added below code in component css file and it's working great..!! :host ::ng-deep .ck.ck-reset.ck-list { |
WDYT @panr? |
@oleq I only came up with this quite hacky idea... So this can be achieved but we need to test it, because we may break some things... I'm gonna prepare a POC soon. |
It's curious whether display:flow-root could help here. |
I check this and it didn't help 😕 Because of |
I am having the same issue with BalloonEditor I tried the above solution |
🆕 Feature request
Is it possible to show scroll bar in the dropdown in toolbar?
For example, I am using Font plugin, which has font family and size. If I have many options then it shows long dropdown. I guess it is not only related with font plugin, it is related with Dropdown view.
Is there any workaround for it?
Is this a bug report or feature request? (choose one)
🐞 Bug report or documentation improvement
💻 Version of CKEditor
12.0.0
📋 Steps to reproduce
✅ Expected result
From my perspective, it would be desired of the inline widget to be treated as part of the text when it comes to styling(bold, italic, font...).
❎ Actual result
The text around the inline widget get styled but the widget itself does not.
📃 Other details that might be useful
I was able to get around this issue with changing the createContainerElement with createAttributeElement, adding a random id and priority 20.
And then adding the text using the private _insertChild converting elementToElement. But this does not seam right.
If you'd like to see this feature implemented, add 👍 to this post.
The text was updated successfully, but these errors were encountered: