Problem/Motivation

CKEditor 5 table cell vertical align uses "middle" by default, but after the entity save vertical align is "top"

Steps to reproduce

  1. Create table with 2 cells
  2. Add a lot of content to left cell
  3. Add a little of content to right cell
  4. CKEditor shows that left cell vertical align is middle
  5. screenshot
  6. After entity save the table cell doesn't have any inline styles
  7. screenshot
  8. But vertical align "top" or "bottom" works fine
  9. screenshot

Proposed resolution

Fix CKEditor to adding inline style to cell "vertical align: middle"

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3436963

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ivnish created an issue. See original summary.

sheetal-wish’s picture

Status: Active » Needs review

According CKEditor 5 library

The table cell vertical alignment

The following values, corresponding to the vertical-align CSS attribute, are allowed:
'top'
'bottom'
The 'middle' value is the default one so there is no need to set it.

for reference please check here https://ckeditor.com/docs/ckeditor5/latest/api/module_table_tablecellpro...

I have checked it with Olivero which has

:is(.forum table,.text-content table,.views-table,.draggable-table) td, :is(.forum table,.text-content table,.views-table,.draggable-table) th {
    padding-block: var(--sp1);
    padding-inline-start: 0;
    padding-inline-end: var(--sp1);
    vertical-align: top;
}

that's why on entity view data shows on top, if you check with another theme i.e. Claro it works fine so workaround can be override css in your theme.

alexpott’s picture

Version: 10.2.x-dev » 11.x-dev

Moving to correct version - we fix things in 11.x first and then backport as necessary / possible.

ivnish’s picture

@sheetal-wish

Yes, looks like Olivero bug

alexpott’s picture

Component: ckeditor5.module » Olivero theme
smustgrave’s picture

Status: Needs review » Active

Moving to active for the fix.

Not sure possible to provide any kind of tests but those would be needed if so.

sheetal-wish’s picture

Status: Active » Needs review
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new1005 bytes

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

ivnish’s picture

Assigned: Unassigned » ivnish
Status: Needs work » Needs review
smustgrave’s picture

My only concern is this could break existing sites if they are using olivero

ivnish’s picture

Yes, I understand. We can commit only in 11.x. Upgrade from 10 to 11 will require reading documentation and changes any way

sourojeetpaul’s picture

Assigned: ivnish » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new74.94 KB
new45.37 KB
new50.07 KB

Hi
I've tested MR !7317 on Drupal 10. It looks fine and the patch applied successfully...
After applying the patch, it shows that the table cells are getting properly vertically center aligned!

RTBC++

Attaching the before and after screenshots for reference

longwave’s picture

We don't promise backward compatibility in Olivero:

# This theme is marked as @internal. It is intended to evolve and change over
# minor releases.
# As the UI of Drupal improves between minor versions, the markup and assets in
# the Olivero theme will change. The Olivero theme is not backwards compatible

I think this is fine to fix in 10.3.0, but we should probably keep it as-is in 10.2.x to avoid surprises for anyone who is using it.

  • nod_ committed f79817a4 on 11.x
    Issue #3436963 by sheetal-wish, ivnish, sourojeetpaul, smustgrave,...

  • nod_ committed 4fadf081 on 10.3.x
    Issue #3436963 by sheetal-wish, ivnish, sourojeetpaul, smustgrave,...

nod_’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed f79817a and pushed to 11.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.