You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Gallery block with class columns-default should also output columns-x #56884
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.
Step-by-step reproduction instructions
Add an instance of the gallery block to a page or post.
Add an image.
Leave the columns count the same (3 in a clean install).
Publish the page or post.
View the page.
Inspect the page's HTML structure.
The wp-block-gallery instance will include the class "columns-default" but not the class "columns-3"
Edit the page/post
Change the columns to a value other than the default.
Save the page/post.
Change the columns back to the default of 3.
Save the page or post.
Inspect the page's HTML structure.
The wp-block-gallery instance will include the class "columns-3" but not the class "columns-default".
Hi, @aleph1@t-hamano 👋 I hope you are doing well. Could you please check this implementation? Let me know if any modification is required. Also, let me know if I have to change the deprecated.js file for this fix.
Activity
devanshijoshi9 commentedon Dec 29, 2023
Hi, @aleph1 @t-hamano 👋 I hope you are doing well. Could you please check this implementation? Let me know if any modification is required. Also, let me know if I have to change the deprecated.js file for this fix.