Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation block - undo trap when initializing 'add all pages' with existing textColor attribute. #33911

Closed
3 tasks done
Addison-Stavlo opened this issue Aug 5, 2021 · 4 comments
Labels
[Block] Navigation Affects the Navigation Block [Block] Page List Affects the Page List Block [Type] Bug An existing feature does not function as intended

Comments

@Addison-Stavlo
Copy link
Contributor

Addison-Stavlo commented Aug 5, 2021

Description

When a navigation block has an existing textColor attribute, the process to initialize via the "Add all pages" option creates an undo trap, preventing the user from being able to undo the action or any previous actions.

related - #8119

Step-by-step reproduction instructions

  1. Map tt1-blocks locally and update block-template-parts/header.html so that the navigation block has a "textColor" attribute. Alternatively you can activate a theme that already does this such as Mayland-blocks from https://github.com/automattic/themes. For this example, I am updating the navigation block in header.html of tt1-blocks by adding a textColor attribute like so: <!-- wp:navigation {"orientation":"horizontal","textColor":"Purple","itemsJustification":"right"} /-->

  2. Load the site editor. You should see your header with an uninitialized navigation block.

  3. Click the navigation block, and select the "Add all pages" option.

  4. Try to "undo" and verify it is not possible to undo the initialization or any actions prior to it.

  5. Undo your change to the header by removing the textColor attribute (if you instead activated Mayland-blocks as the original step, now activate tt1-blocks).

  6. Repeat steps 2-4, and verify this time 'undo' works as expected.

Expected Behavior

Undo to work as expected:

undo works

Current Behavior

Undo is trapped in a loop:

undo trapped

Is there an existing issue for this?

  • I have searched the existing issues

Have you tried deactivating all plugins except Gutenberg?

  • I have tested with all plugins deactivated.

Have you tried replicating the bug using a default theme e.g. Twenty Twenty?

  • I have tested with a default theme.
@Mamaduka
Copy link
Member

Now that we have a default fallback for Navigation block (#42735), I can no longer reproduce this issue.

cc @draganescu

@draganescu
Copy link
Contributor

What does "Map tt1-blocks locally" mean?

@Mamaduka
Copy link
Member

@draganescu, I just translated it to "Install TT1 Blocks locally".

@draganescu
Copy link
Contributor

I can confirm that following #42735 this can't happen anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Block] Page List Affects the Page List Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants