Problem/Motivation

In firefox, when placing an expandable element (e.g. details) within a tabledrag container, expanding the details causes the expanded content to overflow the table cell in unpredictable and unusable ways.

Looking at the code, I'm honestly kind of flummoxed as to why table cells grow in some places but not in others:

tables.pcss.css:

td {
  box-sizing: border-box;
  height: 4rem;
  padding: var(--space-xs) var(--space-m);
  text-align: start;
}

Steps to reproduce

The screenshot above shows a custom_field formatter.

  • Install drupal with the standard profile
  • Install drupal/custom_field
  • Add a field with subfields
  • View the manage display tab for your node type

Proposed resolution

Replace "height: 4rem" with "min-height: 4rem". Doing this does cause some additional shifts in the layout, in Chromium, but those shifts match the current state of display in firefox.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3578398

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

andy-blum created an issue. See original summary.

andy-blum changed the visibility of the branch 3578398-tabledrag-styles-in to hidden.

andy-blum’s picture

This appears to be an area of ambiguity in the specs, in which firefox renders as I think it makes the most sense.

Case 1, what Claro has currently: https://codepen.io/andy-blum/pen/raMWKRZ/2ec77e7622fb9ddd69dc142995c933c3

td {
  height: 64px;
}

Firefox:

The height is locked to the value of 64px, contents that need more space overflow (IMO, expected behavior)

Chrome (safari too):

The height is 64px, but contents that need more space force the td to expand (IMO, unexpected)

Case 2, what this MR changes: https://codepen.io/andy-blum/pen/ogzYyVK/310c5d7e4d667de1fa1c84b18d9eed6c

td {
  min-height: 64px;
}

Firefox, chrome and safari all match behavior here, but min-height is not respected at all.

Height is determined solely by the contents within. Behavior of min-height matches that of height:auto;

bisonbleu’s picture

Status: Active » Needs review

I just ran into this issue and confirming that the changes that the patch provide fixes the table cell overflow.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Bug Smash Initiative

Testing locally I get the same results as @andy-blums screenshots. Seems to address the issue.