gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Post Template block: 'List view' display setting should be selected by default

Open afercia opened this issue 1 year ago • 1 comments

Description

A few blocks have a setting to display their content in a list or grid view:

  • Latest Posts
  • RSS
  • Post Template

The default setting is 'List view'.

When adding a Latest Posts or RSS blocks, their block toolbar does show the 'List view' button selected by default. Screenshots:

Screenshot 2024-05-10 at 09 22 16

Screenshot 2024-05-10 at 09 22 55

The Post Template doesn't. Screenshot:

Screenshot 2024-05-10 at 09 23 35

Step-by-step reproduction instructions

  • Add a Latest Posts block and an RSS block.
  • Observe the block toolbar of both blocks shows the 'List view' button selected by default.
  • Technically, the 'selected' buttons have an aria-pressed="true" attribute and a is-pressed CSS class.
  • Add a Query Loop block, click 'Choose' and then 'Standard'.
  • Select the Post Template block within the Standard Query Loop.
  • Observe the block toolbar shows the 'List view' button as not selected.
  • Observe the button has an aria-pressed="false" attribute and does not have a is-pressed CSS class.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

afercia avatar May 10 '24 10:05 afercia

Hi @afercia, I have raised the PR for the issue - https://github.com/WordPress/gutenberg/pull/61574, Once this PR get's merged, it would list view default selection on the post template as suggested.

Thank You.

hbhalodia avatar May 10 '24 12:05 hbhalodia