[upstream] CKEditor 5 language selector cannot be scrolled if "All NNN languages" option selected

Created on 18 July 2023, over 1 year ago
Updated 22 January 2024, 11 months ago

Problem/Motivation

There are multiple issues with the current CKEditor5 Language tool.

Language choices are limited to three groups. At /admin/config/content/formats/manage/{format} the only options for the Language tool are "United Nations' official languages", "All NNN languages" or "Site configured languages" (recently introduced in โœจ Third option for the CKEditor 5 "Language" button: `site_configured` (in addition to `un` and `all`) RTBC ).

If "All 107 languages" is selected, then when using CKEditor5 on the body of a node, you can click the Language tool to show a vertical list of languages, but the list is not scrollable. If you attempt to scroll down the list the entire page starts juddering (tested using Gitpod, Drupal 10.1.2-dev, Claro admin theme, Chrome 114.0.5735.198).

Steps to reproduce

1. Visit Configuration > Text formats and editors, /admin/config/content/formats
2. Click "Configure" for Basic HTML, /admin/config/content/formats/manage/basic_html
3. Drag "Language" button from Available buttons into Active toolbar
4. In CKEditor 5 plugin settings, select new Language tab.
5. Change selected option to "All 107 languages"
6. On "Source editing" tab add '' (required for language)
7. Click "Save configuration" button.
8. Add content using Basic HTML, e.g. /node/add/article
9. In Body field with CKEditor5, click "Choose lang..." tool, and attempt to select a language "below the fold" (in my case anything after Croatian, ref screenshot โ†’ )
10. Observe that the list of languages is not scrollable.

Proposed resolution

* Allow a smaller, user-selectable set of languages to be selected via Text formats and editors UI.
* Allow a set of languages to specified in config yaml.
* Make the list of available languages scrollable if the list is too large for viewport.

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Postponed

Version

11.0 ๐Ÿ”ฅ

Component
CKEditor 5ย  โ†’

Last updated 6 days ago

Created by

๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand jonathan_hunt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jonathan_hunt
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand jonathan_hunt
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand jonathan_hunt
  • Status changed to Closed: duplicate over 1 year ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    Thanks for reporting this!

    But โ€ฆ this is a duplicate of an issue that is 95% done, can you help get it to 100%? ๐Ÿ˜Š

    Transferring issue credit! ๐Ÿ‘

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand xurizaemon ลŒtepoti, Aotearoa ๐Ÿ

    Looking at โœจ Third option for the CKEditor 5 "Language" button: `site_configured` (in addition to `un` and `all`) RTBC I think there's a really good suggestion here, but it's not what #3273986 implements. I hadn't seen this issue, but I wondered about the same option when working on the other.

    In #3273986 we let the user select "configured" to show the list of Languages configured at /admin/config/regional/language. ("configured" was shorthand for "Site's configured languages" but I'm suddenly thinking it's not a clear name.)

    In #3375157 ID @jonathan_hunt is suggesting a configurable list of languages for use managed I think from the CKEditor plugin configuration - for some sites I do think this might make sense.

    I will factor that into naming the setting over in โœจ Third option for the CKEditor 5 "Language" button: `site_configured` (in addition to `un` and `all`) RTBC in case this issue gets implemented as well. The other issue will have some tests and such to build on at least :)

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland jheinon_finland

    I'd say this issue is still valid as the dropdown menu is still very user unfriendly, when scrolling the languages.

  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand xurizaemon ลŒtepoti, Aotearoa ๐Ÿ

    Agreed, re-titling to focus on the specific scrolling issue & moving back to NW.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States charles belov San Francisco, CA, US

    I suppose there could also be a search filter at the top of the list, which is friendlier than scrolling. An editor could start typing the desired language name into that field and only the matches would show, likely to be a short list. That said, it depends on how the languages are displayed. If they are displayed in their native name rather than the website administration language, typing the name could be an issue, for example, if the editor is trying to retrieve traditional Chinese but can only type in Latin characters.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand xurizaemon ลŒtepoti, Aotearoa ๐Ÿ

    @Charles Belov that's an alternative approach to the one proposed in the issue description (which is fine to do, but the ID remains unchanged). It looks to me like that interface is provided by CKEditor so might be worth thinking about whether CK offers such a filterable dropdown element to use.

    From within Drupal, we can do things such as limit available options (as proposed in ID).

    Fixing scrolling or providing a different UX may require proposing changes upstream in CK.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    Thanks for re-scoping & re-titling! ๐Ÿ‘

    However, in this case โ€ฆ there's indeed nothing to fix on the Drupal side โ€” it can only be fixed upstream. Can you please create an upstream bug report? ๐Ÿ™

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany hexabinaer Berlin, Germany

    I found a fix that makes us less dependent from the cke community providing a fix: CSS, hooray :-)

    .ck-dropdown__panel.ck-dropdown__panel-visible {
      overflow: scroll;
      max-height: var(--ck-min-height);
    }
    

    This is the result of a browser mockup based on Claro. Might need a higher specificity.

  • Status changed to Postponed 11 months ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance duaelfr Montpellier, France

    I opened an upstream issue: https://github.com/ckeditor/ckeditor5/issues/15715

    The suggested fix inspired by #11 could be added to our admin theme CSS as a workaround.

    .ck-text-fragment-language-dropdown .ck-dropdown__panel {
      overflow-x: auto;
      max-height: var(--ck-dialog-max-height);
    }
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance duaelfr Montpellier, France

    FYI upstream issue was closed as duplicate of https://github.com/ckeditor/ckeditor5/issues/952

Production build 0.71.5 2024