-
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
Make global inserter always visible & Fix a Global inserter bug #22115
Make global inserter always visible & Fix a Global inserter bug #22115
Conversation
Size Change: +32 B (0%) Total Size: 1.12 MB
ℹ️ View Unchanged
|
3d5371c
to
4c2bc98
Compare
4c2bc98
to
fa66dff
Compare
hasFixedToolbar: select( 'core/edit-post' ).isFeatureActive( | ||
'fixedToolbar' | ||
), | ||
// This setting (richEditingEnabled) should not live in the block editor's setting. | ||
isInserterEnabled: | ||
select( 'core/edit-post' ).getEditorMode() === 'visual' && | ||
select( 'core/editor' ).getEditorSettings().richEditingEnabled, | ||
isInserterVisible: select( 'core/block-editor' ).hasInserterItems(), | ||
isInserterVisible: hasInserterItems( |
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.
Right now we can "disable" or "hide" the inserter, I wonder if we should just one technique in all cases (disable it) to avoid "jumps"
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.
So essentially you are suggesting a refactor that makes the inserter always visible, although sometimes it can be disabled?
I think it would be a positive change and the UX would be better because the position of the other buttons would not move around and we would be consistent with what happens in other buttons e.g: undo.
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.
yes, something like that.
fa66dff
to
263eec7
Compare
Hi @youknowriad this PR was updated and now makes the global inserter always visible. |
|
||
<!-- wp:columns --> | ||
<div class=\\"wp-block-columns\\"></div> | ||
<!-- /wp:columns -->" |
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.
Not sure I understand why the snapshots change since you add a new test?
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.
I added a columns block to the default template so I can test a CPT locked all with a block without locking. The existing snapshots need to be updated to contain the added columns block.
263eec7
to
8245ee8
Compare
Description
The global inserter never appears if inserting at the root level is not possible. Inserting at the root level may not be possible, while inserting inside a specific block may be possible e.g: if we have CPT with locking all and the columns block inside.
This PR addresses the issue and makes sure the global inserter appears if it is possible to insert a block in the current position where it will be inserted.
How has this been tested?
I added an end to end tests and verified it passes.