Problem/Motivation

When a "Paragraphs (stable)" widget is used, which uses a long list of dropdowns, those items are only "hidden" with CSS, which means they are still present and causing a very long gap of whitespace at the end of the page.

Steps to reproduce

Create a component which uses the "Paragraphs (stable)" widget display type. Create or edit an item. See large white space gap.

Or with only core:

  1. Install demo_umami.
  2. Add an insane amount of operations to every entity. Eg. create a file core/profiles/demo_umami/modules/demo_umami_content/demo_umami_content.module:
    <?php
    
    /**
     * Implements hook_entity_operation().
     */
    function demo_umami_content_entity_operation(\Drupal\Core\Entity\EntityInterface $entity) {
      $operations = [];
      for ($i = 0; $i < 50; $i++) {
        $operations['dummy_' . $i] = [
          'title' => t('Dummy ' . $i),
          'url' => \Drupal\Core\Url::fromRoute('<front>'),
          'weight' => 50,
        ];
      }
    
      return $operations;
    }
    
  3. clear cache
  4. goto /admin/content:
    /admin/content BEFORE

Proposed resolution

Update the Claro theme CSS `dropbutton.css` file for `.dropbutton-wrapper:not(.open) .dropbutton__item:first-of-type ~ .dropbutton__item` items to have a height of 1px, see #12

Remaining tasks

Review

User interface changes

Before

before

After

after

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Issue fork drupal-3374464

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

jennypanighetti created an issue. See original summary.

vpa24’s picture

StatusFileSize
new402 bytes

Thanks, @jennypanighetti, I created a new patch to address the issue.

jennypanighetti’s picture

That works great, thank you so much!

vpa24’s picture

Status: Active » Fixed
luenemann’s picture

Status: Fixed » Needs review

This isn't fixed / committed.

Setting to needs review to run tests.

luenemann’s picture

Issue summary: View changes
smustgrave’s picture

Version: 10.1.x-dev » 11.x-dev
Status: Needs review » Needs work

Is this replicated in core without a contrib module?

MR should be updated for 11.x as it will have to land there first to be backported.

luenemann’s picture

Issue summary: View changes
StatusFileSize
new29.72 KB

IS update for Steps to reproduce.

luenemann’s picture

StatusFileSize
new48.36 KB
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs manual testing +Needs Review Queue Initiative

Can confirm the issue with the hook suggested in IS.
The MR 4382 did solve the issue.

Think it would be good to get this in now as the other may take a bit longer as it's a bigger fix.

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work

This reverts a UI fixm in #3168326: Dropbuttons in table cells are potentially unusable if it includes options with long text length. that prevented dropbutton items from being available to users.

.dropbutton-wrapper:not(.open) .dropbutton__item:first-of-type ~ .dropbutton__item {
  visibility: hidden;
  display: none;
}

It might be possible to get it working with setting .dropbutton-wrapper:not(.open) .dropbutton__item:first-of-type ~ .dropbutton__item to a very tiny height. This means they would still occupy the width needed to keep the fix intact, but it won't consume that vertical space when the button is closed.

vpa24’s picture

Hello @bnjmnm, I think we can't use both visibility: hidden; and display: none; together, and it doesn't make sense, as they serve similar purposes of hiding elements but in different ways.

When you use visibility: hidden; the element becomes invisible, but it still occupies space on the page. On the other hand, when you use display: none; the element is completely removed from the layout.

bnjmnm’s picture

Re #13

Hello @bnjmnm, I think we can't use both visibility: hidden; and display: none; together, and it doesn't make sense, as they serve similar purposes of hiding elements but in different ways.

When you use visibility: hidden; the element becomes invisible, but it still occupies space on the page. On the other hand, when you use display: none; the element is completely removed from the layout.

I see you mentioning my name as if you're responding to my suggestion in #12, the content of your response has nothing to do with my recommendation.

To reiterate, I'm saying don't change the visibility rules at all. Instead, set the height of collapsed splitbutton items to a very small height. That way they consume the horizontal space needed to retain the fix from #3168326: Dropbuttons in table cells are potentially unusable if it includes options with long text length. but occupy a very small amount of vertical space thus fixing the problem reported.

vpa24’s picture

Version: 11.x-dev » 10.1.x-dev
bnjmnm’s picture

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

@vpa24, do not switch this to 10.1.x - 11.x is the dev branch for Drupal. 10.x releases are tagged from it. It's a little confusing but when in doubt just keep it at 11.x

******************

Reminder the solution I suggested in #12 & #14 should work, for those interested in seeing this addressed.

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

utkarsh_33’s picture

StatusFileSize
new371.76 KB
new578.9 KB

Hi Ben I added the height to the required element and it seems to work fine.Attaching the screenshots for the same
Before:-
Before
After:-
After

utkarsh_33’s picture

Status: Needs work » Needs review
smustgrave’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Cleaned up the issue summary some using the screenshots posted by @Utkarsh_33.

Solution seems good and matches the recommendation by @bnjmnm in #12

nod_’s picture

Status: Reviewed & tested by the community » Needs work

can we add a comment as to why we need to have the height changed in the CSS? I'm sure i'll wonder why it's there in a few months.

utkarsh_33’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Comment added.

  • nod_ committed c86c4687 on 10.3.x
    Issue #3374464 by luenemann, Utkarsh_33, vpa24, jennypanighetti,...

  • nod_ committed 7ca75f44 on 10.4.x
    Issue #3374464 by luenemann, Utkarsh_33, vpa24, jennypanighetti,...

  • nod_ committed f0fefd61 on 11.0.x
    Issue #3374464 by luenemann, Utkarsh_33, vpa24, jennypanighetti,...

  • nod_ committed bc18f365 on 11.x
    Issue #3374464 by luenemann, Utkarsh_33, vpa24, jennypanighetti,...
nod_’s picture

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

Committed and pushed bc18f36525 to 11.x and f0fefd6153 to 11.0.x and 7ca75f443f to 10.4.x and c86c46871a to 10.3.x. Thanks!

Status: Fixed » Closed (fixed)

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