-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix slash inserter for widgets screen #33161
Merged
Merged
Conversation
This file contains 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
talldan
added
[Feature] Inserter
The main way to insert blocks using the + button in the editing interface
[Type] Regression
Related to a regression in the latest release
[Feature] Widgets Screen
The block-based screen that replaced widgets.php.
labels
Jul 2, 2021
talldan
added
the
Backport to WP 6.7 Beta/RC
Pull request that needs to be backported to the WordPress major release that's currently in beta
label
Jul 2, 2021
talldan
requested review from
tellthemachines,
kevin940726,
adamziel,
draganescu and
getdave
July 2, 2021 08:48
Size Change: -8 B (0%) Total Size: 1.05 MB
ℹ️ View Unchanged
|
Mamaduka
approved these changes
Jul 2, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Thanks @Mamaduka! |
youknowriad
pushed a commit
that referenced
this pull request
Jul 5, 2021
youknowriad
removed
the
Backport to WP 6.7 Beta/RC
Pull request that needs to be backported to the WordPress major release that's currently in beta
label
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Inserter
The main way to insert blocks using the + button in the editing interface
[Feature] Widgets Screen
The block-based screen that replaced widgets.php.
[Type] Regression
Related to a regression in the latest release
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
insertionPoint
state 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
false
after #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
insertionPoint
state 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.js
files for terms that need renaming or removal).