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.47k forks source link

Cannot set default font family/size if selection does not start inside styling span #1116

Open f1ames opened 7 years ago

f1ames commented 7 years ago

Are you reporting a feature request or a bug?

Bug

Check if the issue is already reported

Related to #525 and #584.

Provide detailed reproduction steps (if any)

  1. Go to http://nightly.ckeditor.com/17-11-03-07-04/full/samples/.
  2. Set content to <p>foo <span style="font-size:20px">bar</span> baz</p> .
  3. Select <p>f{oo <span style="font-size:20px">bar</span> b}az</p> .
  4. Open font size dropdown and apply (Default).

Expected result

Selected text font size is changed to default one.

Actual result

Selected text font size does not change.

Before change in #584, this issue was not visible. Removing the size was done by toggling option in a dropdown, however when selection does not start in the styling span the dropdown was not highlighting the proper item (which #525 is now trying to solve) so it was not possible to toggle.

Other details

msamsel commented 4 years ago

It might be helpful to check this commit. There are removed parts, which initially I want to use to fix this bug together with introducing font commands. https://github.com/ckeditor/ckeditor4/pull/3375/commits/1b67e6a073274dbab9e5454c322346ff17b947b6