In some cases (such as using :empty css selector) to an empty row should be no spaces.

Before patch:

<div class="row">
    
  </div>

After patch:
<div class="row"></div>

CommentFileSizeAuthor
remove_spaces_around_content.patch2.01 KBAnonymous (not verified)

Comments

Anonymous’s picture

vaplas created an issue. See original summary.

hotpizzas’s picture

Patch applied cleanly, but unable to reproduce. Tested grid and list display view with empty row. Maybe an example view to recreate could help see where this is occurring.

Anonymous’s picture

@hotpizzas, thank you for callback. Maybe an example as related post 2789909#3. This code can also help to reproduce this problem:

function HOOK_views_post_render(ViewExecutable $view, &$output, CachePluginBase $cache) {
  if($view->id() == 'ID'){
    for($i = 0; $i < 5; $i++) {
      $output['#rows'][0]['#rows'][] = [];
    }
  }
}

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Anonymous’s picture

Status: Needs review » Closed (duplicate)

Now this patch is included in #2789909: Remove spaces around row.content.