Merged
Conversation
|
Size Change: -8 B (0%) Total Size: 1.05 MB
ℹ️ View Unchanged
|
Mamaduka
approved these changes
Jul 2, 2021
Member
Mamaduka
left a comment
There was a problem hiding this comment.
Tested and works as expected 👍
- Now I can see slash inserted in Widgets editor
- There's no regression for original behavior. I don't see an in-between inserter for CTP where the template is locked.
Contributor
Author
|
Thanks @Mamaduka! |
youknowriad
pushed a commit
that referenced
this pull request
Jul 5, 2021
youknowriad
pushed a commit
that referenced
this pull request
Jul 6, 2021
youknowriad
pushed a commit
that referenced
this pull request
Jul 7, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #33099
#32576 caused a bug in the widget screen where the slash inserter would often not work.
To fix it, this PR follows the advice in https://github.com/WordPress/gutenberg/pull/32576/files#r649890607, and avoids setting the
insertionPointstate in the first place in a template locked block list.The cause of the problem is that after #32576, the insertion point state would get set for the root template-locked block list in the widget editor, but never cleared. It wouldn't be cleared because the code that unsets it uses a selector that returned
falseafter #32576 to check if it should be cleared:gutenberg/packages/block-editor/src/components/block-list/use-in-between-inserter.js
Lines 53 to 55 in f077bbe
Whenever inserting blocks using the slash inserter, the
insertionPointstate that was stuck in the store would be used as a basis of populating the slash inserter, but because that state considers the block list to be template locked, no blocks are allowed, therefore causing the slash inserter to not appear.How has this been tested?
Screenshots
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist:
*.native.jsfiles for terms that need renaming or removal).