Problem/Motivation

On nested paragraphs if the paragraph type title is longer than 100px it gets cut off. This happens because the paragraphs module css add flex-basis: 100px;

Steps to reproduce

Add a nested paragraph that has a long title like 'Accordion item' and make sure you are using the experimental widget.

Proposed resolution

Override with flex-basis: auto;

Issue fork paragraphs-3246140

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:

Issue fork gin-3246140

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

ipwa created an issue. See original summary.

ipwa’s picture

Issue summary: View changes
StatusFileSize
new861.87 KB
ipwa’s picture

Issue summary: View changes
ipwa’s picture

Issue summary: View changes
saschaeggi’s picture

Might be better to address this directly to the paragraphs module? As it might be an improvement for all users (?)

ipwa’s picture

StatusFileSize
new733 bytes

Adding patch that was already made for Gin.

ipwa’s picture

Sascha good point I will create a patch for the paragraphs module and then upload it and change the project of the issue. If for some reason they don't want the change I will change the project back to Gin and we can decide if it goes in as an override in Gin. Thanks :)

saschaeggi’s picture

Project: Gin Admin Theme » Paragraphs
Version: 8.x-3.x-dev » 8.x-1.x-dev

Moved the issue, cheers :)

Oleksandr P. made their first commit to this issue’s fork.

oleksandr p.’s picture

Assigned: Unassigned » oleksandr p.
oleksandr p.’s picture

Assigned: oleksandr p. » Unassigned
Status: Active » Needs review
StatusFileSize
new846 bytes

Here is the patch fixing an issue.

Status: Needs review » Needs work

The last submitted patch, 11: 3246140-11-fix_paragraph_title_cutoff.patch, failed testing. View results

oleksandr p.’s picture

Status: Needs work » Needs review

Test failed unrelated.

Status: Needs review » Needs work

The last submitted patch, 11: 3246140-11-fix_paragraph_title_cutoff.patch, failed testing. View results

darvanen’s picture

Status: Needs work » Needs review

Manual testing passes.

I thought perhaps the lines should be removed instead of setting to 'auto' but that didn't work, so the code looks good to me too.

I'm not 100% convinced the test suite fails are unrelated but I haven't gone digging so I'll split the difference and return it to NR.

geela’s picture

StatusFileSize
new104.29 KB
new49.32 KB

I manually reviewed this and seems to work. Steps below are taken:

-Downloaded Drupal 9.5.10 and paragraph module (git 8.x-1-dev).
-Downloaded the patch on #14 and applied.
-Then complied the .scss and cleared cached
-See 2 attached, seems to show complete title for the nested paragraph

bburg’s picture

I tried the patch in #11, and I still see my paragraph type labels cut off to 100px. I think that is because of this rule:

.js  .paragraph-top {
    grid-template-columns: 100px auto 1fr auto; 
...

Is there any harm in using "auto auto 1fr auto" here instead?

bburg’s picture

Here is a patch with the change I proposed in my last comment. Not including an interdiff due to the simplicity.

Edit: and some changes seemed to be trivial differences from the compilation process.

bburg’s picture

After applying the patch from my last comment, I saw there was an additional spot that needed an update.

pivica’s picture

Status: Needs review » Needs work

@bburg we have some activity in #3350521: Paragraph with long label name gets cut off issue which is a duplicate of this issue. I've closed that one but feedback in comment #3350521-14 still applies here. In short we can't change that grid width for first column from px to auto because it will mess with collapse summary rendering. Same comment has some ideas how to solve this better.

nayana_mvr made their first commit to this issue’s fork.

nayana_mvr’s picture

Status: Needs work » Needs review
StatusFileSize
new10 MB

Hi @pivica, I just attempted to fix this issue as per your suggestions in the comment #3350521-14 and created the MR132. Please see if this is the expected solution. If this is fine, then I will refactor summary rules to use the new class. Also, attaching a screen recording for reference.

pivica’s picture

Hi @nayana_mvr thanks for update but unfortunately I can not open mov format on my Linux. Anyway I think for this kind of problems screenshots are anyway better for reviewing stuff. I will try to test your MR in the evening and do more detail test locally but what I see right now is that previous patch in this commit (for example comment #19) was doing some additional CSS changes and not just changing from 150px to auto. What are we going to do with those additional stuff?

nayana_mvr’s picture

Hi @pivica,
Yes, there are some additional CSS changes in the patch which I think is not really required for this issue. One is related to changing flex-basis: 100px; to flex-basis: auto; for the element .paragraph-type-title. But I couldn't find any such element in the paragraphs UI. I noticed that that change was part of the patch #11 which was not working as per comment #17.
The other change is related to .paragraphs-convert-button element which is again not available in the UI. Also, when I applied the patch in #19, that change was not getting applied. If possible, could you please check it from your end as well?
Attaching few screenshots also for reviewing.

s3b0un3t’s picture

Hello,

I tested the current MR with the latest released version of the module (8.x-1.19). This fixes the cut wording issue (when the paragraph is expanded), however I now have 4 warnings:

  • Warning: Undefined array key "top" in paragraphs_field_widget_single_element_form_alter() (line 530 of modules/contrib/paragraphs/paragraphs.module).
  • Warning: Trying to access array offset on null in paragraphs_field_widget_single_element_form_alter() (line 530 of modules/contrib/paragraphs/paragraphs.module).
  • Warning: Trying to access array offset on null in paragraphs_field_widget_single_element_form_alter() (line 530 of modules/contrib/paragraphs/paragraphs.module).
  • Warning: Trying to access array offset on null in paragraphs_field_widget_single_element_form_alter() (line 530 of modules/contrib/paragraphs/paragraphs.module).
    • The first condition is too permissive and is valid for my "moderation_state" field (which haven't a "top" key).

s3b0un3t’s picture

Here is my patch proposal.

I can create a fork and a merge request if it's good for you.

alton307’s picture

Hey recently had the same issue and decided to create a combined patch file until the issue is merged into the main branch.

Patch contains the following:

  • initial patch from oleksandr p: #11
  • MR changes from nayana_mvr : #23
  • Fixes to MR from s3b0un3t #27

hopefully this helps!

arthur.baghdasar’s picture

Status: Needs review » Needs work
mistrytheory’s picture

Added a new patch based on alton307's one, but for 8.x-1.20

sker101’s picture

rerolling patch for latest of 1.x-dev with a small test coverage.

yovince’s picture

StatusFileSize
new3.9 KB

Drupal 11.4.x, paragraphs: 1.22.0