openeuropa / oe_theme

Drupal 10 theme based on the Europa Component Library (ECL).
European Union Public License 1.2
31 stars 31 forks source link

3.5.0 Theme breaks Drupal drag and drop functionality #1300

Open LOBsTerr opened 1 year ago

LOBsTerr commented 1 year ago

after update to 3.5.0 we can drag the item, but we can't drop them anymore. For example when we edit a node with paragraphs or table with drag and drop feature. To reproduce we need sortable table, where we can drag and drop items and also set their weight

LOBsTerr commented 1 year ago

Actually, we found the reason the select components doesn't apply necessary Drupal classes in ecl-select.html.twig:

{% set _css_group_class = 'ecl-form-group' %}
{% set _css_class = ['ecl-select'] %}
{% set _css_class = _css_class|join(' ') %}

And this breaks drag and drop. This our fix:

{% set _css_group_class = 'ecl-form-group' %}
{% set _css_class = ['ecl-select'] %}
{% set _css_class = _css_class|merge(attributes.class) %}
LOBsTerr commented 1 year ago

To be more precise we are missing this class "table-sort-weight".

22Alexandra commented 1 year ago

Hi @LOBsTerr, could you please point to some pages where this can be seen? Using oe_theme for editing and creating content doesn't seem to allow drag&drop at all and the oe_theme table.html.twig template uses the ECL Table component (ecl-table.html.twig).

The ecl-select.html.twig template is used for the select form element.

LOBsTerr commented 1 year ago

Hi @22Alexandra, we managers the admin is not allow and they are using oe_theme to update the content and change the configuration of their groups.

I think the easiest way to add a paragraph field and add a few paragraphs then you can see drag and drop feature there. And it is broken, because of the missing classes

upchuk commented 1 year ago

@LOBsTerr https://github.com/openeuropa/oe_theme/pull/1317 can you see if this PR fixes your issue?