gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Buttons block: 1st button doesn't inherit the preferred default style

Open kmadhak opened this issue 6 years ago • 5 comments

Describe the bug in Button Block the "Default Style" is set to "Outline" instead of "Not set"

Steps to reproduce the behaviour:

  1. Go to 'Editor'
  2. Add new page
  3. Click on 'add block'
  4. Select the block 'Button'
  5. View the options of 'Default Style' drop down
  6. See error

Expected behaviour instead of showing "Outline" in drop down we have to show "Not set" as default in drop down

Screenshots https://prnt.sc/vovex9

Video for more detail please view the attached video https://www.loom.com/share/93958a6d4c3b427bad3c16a33a6af450

Editor version: WordPress version: 5.6-RC1

Desktop: OS: Windows Browser chrome Version 86.0.4240.193 (Official Build) (64-bit)

kmadhak avatar Nov 24 '20 06:11 kmadhak

I can't reproduce this in Chrome on Windows. Adding a Buttons block, the Style is set to "Fill" and Default style is "Not set".

@kmadhak are you using any particular theme or plugin that might be setting a different default?

tellthemachines avatar Nov 27 '20 00:11 tellthemachines

Hello @tellthemachines, thanks for providing the replay.

As I am not using and plugin or different theme setting then also the button Default style is "Outline" instead of "Not set", for more details I have attached a video, please look into it and let me know your feedback.

Video: https://www.loom.com/share/cb768f7e5bc64350be42e6d2fc16da26

Thank you.

kmadhak avatar Nov 27 '20 05:11 kmadhak

Thanks for the video @kmadhak ! After some testing I think I've found the cause: when you change the default style in a Buttons block, the browser will store that option, and the next time you add a Buttons block to a post it will have whichever option you previously chose selected by default. You can confirm this by logging into your site in incognito mode, or from a different browser, and verifying that the default style is displaying correctly as "Not set".

I did find a bug in how this works: if the default style is set to "Outline", the block should automatically adopt that style when added to the page. That isn't currently happening: if I set my default style to "Outline" and add a new block, its style is still "Fill". I can also reproduce this issue in 5.5.3, so it's not a 5.6 regression.

tellthemachines avatar Nov 29 '20 23:11 tellthemachines

Hello @tellthemachines,

Greetings of the day!!!

I would like to know the progress of this issue, please let me know if you need more detail on it.

Thank you.

kmadhak avatar Apr 27 '21 05:04 kmadhak

I changed the title of this ticket to make it more clear what the issue is. There is a draft PR on https://github.com/WordPress/gutenberg/pull/31089 exploring this issue, the problem is the template we pass to inner blocks

aristath avatar Apr 27 '21 05:04 aristath