ckeditor / ckeditor4

The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.
https://ckeditor.com/ckeditor-4
Other
5.79k stars 2.48k forks source link

Dropdowns reflect only the beginning / start of selection. #525

Open jswiderski opened 7 years ago

jswiderski commented 7 years ago

Are you reporting a feature or a bug?

Feature request

Check if the issue is already reported

https://dev.ckeditor.com/ticket/13553

Provide detailed reproduction steps (if any)

  1. Create 3 paragraphs with 3 different fonts e.g.
    <p><span style="font-family:Comic Sans MS,cursive">test1</span></p>
    <p><span style="font-family:Georgia,serif">test2</span></p>
    <p><span style="font-family:Lucida Sans Unicode,Lucida Grande,sans-serif">test3</span></p>
  2. Select all content

Expected result

Font dropdown doesn't show any font.

Actual result

Font dropdown shows font from first paragraph.

Other details

NOTE: This is how selection and styles work in the editor. Dropdowns always reflect beginning of selection. Perhaps here we could check if selection contains something more than one element and more than one font and if it does, simply not showing any font. Same goes for font-size, format and styles.

mlewand commented 7 years ago

The feature sounds reasonable, though it's not crucial for us ATM. We can get back to it at some point.

Comandeer commented 7 years ago

I've prepared the first, WIP implementation of this feature for font plugin, it's on t/525 branch. It's already integrated with tableselection plugin (or, more generally speaking, multiple ranges).

However there are some issues with new selection from the same element as the first one. Due to the fact how our selectionChange works it's impossible to correctly detect changes. It would probably require some major changes in richcombo plugin.

There is also need to implement this feature also for format and styles plugins.

akashbiz commented 6 years ago

+1 Facing same issue for font size, any update on this?

mlewand commented 6 years ago

@akashbiz please add 👍 reaction to the main comment of this issue. As for the updates you can see that it has been tackled in #745 but it has not been updated recently. You can always apply the code from that PR and use patched version if it's important for you.

mlewand commented 6 years ago

There are plenty of tutorials on how to do that around the need, google around and I'm sure you'll find it.