Skip to content

[Fix-#56884] Gallery block with class columns-default should also output columns-x - #57447

Open
devanshijoshi9 wants to merge 1 commit into
WordPress:trunkfrom
devanshijoshi9:fix/56884-show-class-x-along-with-columns-default-in-gallery-block
Open

devanshijoshi9 wants to merge 1 commit into
WordPress:trunkfrom
devanshijoshi9:fix/56884-show-class-x-along-with-columns-default-in-gallery-block

Conversation

@devanshijoshi9

@devanshijoshi9 devanshijoshi9 commented Dec 29, 2023 •

Copy link
Copy Markdown
Contributor

Fix: #56884

Why?

When adding a new gallery block instance and not changing the columns, the container element includes the class "columns-default", but does not include a class for the number of columns that the default is set to (for example, "columns-3"). If you switch the columns manually to a number other than the default (3) and then switch back to the 3. The instance will now be output with the class "columns-3" but will not include "columns-default".

Arguably the initial instance should display "columns-default" and "columns-3" to make styling easier, and to be of use to and custom JavaScript that needs to determine the number of columns the gallery block is intended to display. Also, after the column count being changed to a value other than 3 and then set to 3 again, the class "columns-default" should probably be added back.

How?

  • Added default column count attribute to add column-{default-column-column} along with column-default class while column is not set explicitly.

Testing Instructions

  1. Open a post or page.
  2. Insert a gallery block.
  3. Select images ( Without changing the columns from inspectorControl )
  4. Save the post/page and check the classes added in Gallery>figure HTML element using inspect element.

Testing Instructions for Keyboard

Screenshots or screencast

Screenshot 2023-12-29 at 2 08 28 PM

@github-actions

github-actions Bot commented Dec 29, 2023 •

Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: [Block] Gallery.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions

Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

2 similar comments
@github-actions

Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions

Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@skorasaurus skorasaurus added the [Block] Gallery Affects the Gallery Block - used to display groups of images label Feb 22, 2024

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Gallery Affects the Gallery Block - used to display groups of images

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gallery block with class columns-default should also output columns-x

2 participants